-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Loading holidays from yml file does not work #4
Comments
Or even |
I've also spotted this issue on 0.3.1.. |
Tom, if you aren't able to access my pull request (as it's made from a private repo), I can send you a patch. |
I'll just access the patch from your repo at; git://github.com/abatish/business_time.git Thanks! |
thx atonse, now seems to work with git repos |
Is this still a concern? I recently accepted several pullups and I'm not sure if I should close this issue. |
This is still a problem. I added business_time to my rails server today and was wondering why i was getting TimeZone objects as my holidays and came across this issue. |
I ended up making these changes for it to work. Parsing the holidays as times does nothing, seeing as they need to be dates. Even the example in the readme shows them to be dates, so I'm not sure why they are created as times in config file. lib/business_time/config.rb: change 75 Time.zone ? Time.zone.parse(holiday) : Time.parse(holiday) to 75 Date.parse(holiday) |
This issue is still present. I've forked the repo, fixed it and submitted a pull request using the suggestion made by gama. offtopic: It's worth to say somewhere in README or even in the bussines_time.yml template that it is possible to add year agnostic dates to the holidays. i.e. 4th of July is a holiday which happens every year, and not only in 2010 as you wrote down in yml file. |
This should be fixed by #18, let me know if you have any more problems, |
There's a set of enclosing parentheses missing in file lib/business_time/config.rb, line 50. As is, I get TimeZone objects:
prompt$ script/runner 'puts BusinessTime::Config.holidays.collect(&:to_s)'
(GMT-05:00) Eastern Time (US & Canada)
(GMT-05:00) Eastern Time (US & Canada)
...
Changing the line to "(Time.zone ? Time.zone.parse(holiday) : Time.parse(holiday))", it works fine:
prompt$ script/runner 'puts BusinessTime::Config.holidays.collect(&:to_s)'
2010-01-01 00:00:00 -0500
2010-01-18 00:00:00 -0500
...
The text was updated successfully, but these errors were encountered: