Commit 77d3e5bd by liyijie

feat: between_times support string

parent f8253f1e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require File.expand_path("../lib/by_star/version", __FILE__) require File.expand_path("../lib/by_star/version", __FILE__)
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = "by_star" s.name = "ta_by_star"
s.version = ByStar::VERSION s.version = ByStar::VERSION
s.authors = ["Ryan Bigg", "Johnny Shields"] s.authors = ["Ryan Bigg", "Johnny Shields"]
s.email = ["radarlistener@gmail.com"] s.email = ["radarlistener@gmail.com"]
......
module ByStar module ByStar
module Between module Between
def between_times(*args) def between_times(*args)
options = args.extract_options!.symbolize_keys! options = args.extract_options!.symbolize_keys!
start_time, end_time = ByStar::Normalization.extract_range(args) start_time, end_time = ByStar::Normalization.extract_range(args)
start_time = start_time.to_time if start_time.is_a?(String)
end_time = end_time.to_time if end_time.is_a?(String)
offset = options[:offset] || 0 offset = options[:offset] || 0
field_type = by_star_field_type(options) field_type = by_star_field_type(options)
...@@ -172,7 +173,7 @@ module ByStar ...@@ -172,7 +173,7 @@ module ByStar
end end
def next_week(options = {}) def next_week(options = {})
between_times(Time.current, Time.current + 1.week, options) between_times(Time.current, Time.current + 1.week, options)
end end
def next_fortnight(options = {}) def next_fortnight(options = {})
......
module ByStar module ByStar
VERSION = '4.0.0' VERSION = '4.1.0'
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment