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

Add support for localized date references #12822

Merged
merged 2 commits into from Dec 3, 2013

Conversation

Projects
None yet
5 participants
@cbartlett
Contributor

cbartlett commented Nov 9, 2013

Ruby's Date class automatically gives us #yesterday, #today, and #tomorrow. And ActiveSupport has a handy Time.zone.today for getting a localized version. But there was no localized version of #yesterday or #tomorrow.

This patch adds those methods.

Any thoughts on this? I think if we offer #today to mimic the behavior of Date, perhaps we should also offer #tomorrow and #yesterday? I ran into the problem when localizing an app and converting a bunch of Date.today and Date.tomorrow usages.

@senny

This comment has been minimized.

Show comment
Hide comment
@senny
Member

senny commented Nov 9, 2013

@senny

View changes

Show outdated Hide outdated activesupport/test/time_zone_test.rb
@pixeltrix

This comment has been minimized.

Show comment
Hide comment
@pixeltrix

pixeltrix Dec 3, 2013

Member

@cbartlett can you provide a CHANGELOG entry as well - thanks

Member

pixeltrix commented Dec 3, 2013

@cbartlett can you provide a CHANGELOG entry as well - thanks

@cbartlett

This comment has been minimized.

Show comment
Hide comment
@cbartlett

cbartlett Dec 3, 2013

Contributor

@pixeltrix CHANGELOG added.

Contributor

cbartlett commented Dec 3, 2013

@pixeltrix CHANGELOG added.

cbartlett added some commits Nov 9, 2013

Add support for localized date references
Ruby's Date class automatically gives us #yesterday, #today,
and #tomorrow. And ActiveSupport has a handy Time.zone.today
for getting a localized version. But there was no localized
version of #yesterday or #tomorrow. Until now.
@cbartlett

This comment has been minimized.

Show comment
Hide comment
@cbartlett

cbartlett Dec 3, 2013

Contributor

@senny @carlosantoniodasilva All done. Test update to use travel_to, thanks!

Contributor

cbartlett commented Dec 3, 2013

@senny @carlosantoniodasilva All done. Test update to use travel_to, thanks!

@pftg

This comment has been minimized.

Show comment
Hide comment
@pftg

pftg Dec 3, 2013

Contributor

@cbartlett please squash commits

Contributor

pftg commented Dec 3, 2013

@cbartlett please squash commits

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Dec 3, 2013

Member

@pftg first one is a refactoring of existing code. I think it's fine to keep them separated.

Member

senny commented Dec 3, 2013

@pftg first one is a refactoring of existing code. I think it's fine to keep them separated.

@cbartlett

This comment has been minimized.

Show comment
Hide comment
@cbartlett

cbartlett Dec 3, 2013

Contributor

@pftg I rebased all my related commits together before i pushed. The other commit wasn't related to my addition.

Contributor

cbartlett commented Dec 3, 2013

@pftg I rebased all my related commits together before i pushed. The other commit wasn't related to my addition.

@carlosantoniodasilva

This comment has been minimized.

Show comment
Hide comment
@carlosantoniodasilva

carlosantoniodasilva Dec 3, 2013

Member

Looks good, thanks 👍

Member

carlosantoniodasilva commented Dec 3, 2013

Looks good, thanks 👍

@pftg

This comment has been minimized.

Show comment
Hide comment
@pftg

pftg Dec 3, 2013

Contributor

I see, sorry for worries

Contributor

pftg commented Dec 3, 2013

I see, sorry for worries

@cbartlett

This comment has been minimized.

Show comment
Hide comment
@cbartlett

cbartlett Dec 3, 2013

Contributor

@pftg ничего страшного)

Contributor

cbartlett commented Dec 3, 2013

@pftg ничего страшного)

carlosantoniodasilva added a commit that referenced this pull request Dec 3, 2013

Merge pull request #12822 from cbartlett/master
Add support for localized date references

@carlosantoniodasilva carlosantoniodasilva merged commit 1441961 into rails:master Dec 3, 2013

1 check was pending

default The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment