shekibobo / time_splitter

Easily split Time/DateTime attribute accessors on your models for date, time, hour, and minute.

Home Page:https://github.com/shekibobo/time_splitter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specify timezone

dkrusenstrahle opened this issue · comments

Hello,

How can I set timezone?
When I select a date it automatically saves it in UTC format which is wrong here in Sweden.

Thanks!

TimeSplitter uses a default time of zero. You can override this by passing your own Time value in a lambda for the default option of split_accessor. Something like default: ->{Time.zone.now}

Hello. Great gem!
You might want to add something about the timezone to the README, because when I first used the gem, it was saving my dates as one day off because my Rails config.time_zone = 'Eastern Time (US & Canada)'. So starting with a default time in UTC and then changing it was causing havoc. Setting default: ->{Time.zone.now} fixed the issue.