mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Merge pull request #268 from gboudreau/fix/gh-194-timespans-in-negative-tz
Bugfix: when calculating the timestamp (for months and years), ignore the Timezone
This commit is contained in:
commit
d76e1a4052
1 changed files with 3 additions and 3 deletions
|
|
@ -11,14 +11,14 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
def year_timespan(year)
|
||||
start_at = Time.utc(year).in_time_zone(Time.zone).beginning_of_year.strftime('%Y-%m-%dT%H:%M')
|
||||
end_at = Time.utc(year).in_time_zone(Time.zone).end_of_year.strftime('%Y-%m-%dT%H:%M')
|
||||
start_at = Time.new(year).beginning_of_year.strftime('%Y-%m-%dT%H:%M')
|
||||
end_at = Time.new(year).end_of_year.strftime('%Y-%m-%dT%H:%M')
|
||||
|
||||
{ start_at:, end_at: }
|
||||
end
|
||||
|
||||
def timespan(month, year)
|
||||
month = DateTime.new(year, month).in_time_zone(Time.zone)
|
||||
month = DateTime.new(year, month)
|
||||
start_at = month.beginning_of_month.to_time.strftime('%Y-%m-%dT%H:%M')
|
||||
end_at = month.end_of_month.to_time.strftime('%Y-%m-%dT%H:%M')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue