date_period_parser:解析日期日期字符串并返回开始和结束日期时间

时间:2021-05-05 15:39:25
【文件属性】:
文件名称:date_period_parser:解析日期日期字符串并返回开始和结束日期时间
文件大小:10KB
文件格式:ZIP
更新时间:2021-05-05 15:39:25
Ruby DatePeriodParser 解析日期日期字符串,例如2015-Q1,并返回开始和结束日期时间。 对于报告/分页/搜索以过滤给定时间段的记录很有用。 它不是像那样的自然语言日期解析器。 但是打算解析常见格式,例如 。 # Example useage in a rails controller action # GET /posts?period=2015-08 def index date_range = DatePeriodParser . range ( params [ "period" ] , default : "today" ) @posts = Posts . where ( created_at : date_range ) end 期间示例: 年YYYY 月YYYY-MM 日期YYYY-MM-DD 开局之年/月至今ytd , mtd sh
【文件预览】:
date_period_parser-master
----LICENSE.txt(1KB)
----date_period_parser.gemspec(1KB)
----lib()
--------date_period_parser.rb(7KB)
--------date_period_parser()
----Gemfile(103B)
----spec()
--------date_period_parser_spec.rb(11KB)
----Rakefile(135B)
----.travis.yml(152B)
----README.md(5KB)
----.gitignore(87B)
----bin()
--------console(343B)
--------setup(115B)

网友评论