Skip to content
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

Return timestamp in Profile events list #1360

Merged
merged 4 commits into from
Apr 12, 2017
Merged

Return timestamp in Profile events list #1360

merged 4 commits into from
Apr 12, 2017

Conversation

jessieay
Copy link
Contributor

WHY: Users should be able to see the time AND date for events in their account history.

screen shot 2017-04-12 at 11 33 35 am

**WHY**: Users should be able to see the time AND date for events in their account history.
@@ -9,3 +9,4 @@ en:
email_changed: Email address changed
phone_changed: Phone number changed
phone_confirmed: Phone confirmed
timestamp: '%{date} at %{time} (Eastern)'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This key is very specific to eastern time, can we put that in the key name somewhere? timestamp_eastern ?

def to_s
I18n.t(
'event_types.timestamp',
date: eastern_timestamp.strftime('%B %e, %Y'),
Copy link
Contributor

@zachmargolis zachmargolis Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a good use for I18n.l?

# some translation.yml
en:
  time:
    formats:
      date: '%B %e, %Y'
      time: '%-l:%M %p'
I18n.t(
  'event_types.timestamp',
  date: I18n.l(eastern_timestamp, format: :date),
  time: I18n.l(eastern_timestamp, format: :time)
)

And I know on our ticket we specified full "Eastern" but I think we could get close with "%Z":

en:
  time:
    formats:
      event_timestamp: "%B %e, %Y at %-l:%M %p (%Z)"
I18n.l(eastern_timestamp, format: :event_timestamp)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COOL! love that use of I18n.l

done here: f8f0212

note that I went without the %z since that output an integer and @andrewhughey was pretty clear in the GH issue that he wanted "Eastern" for clarity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I meant capital '%Z' which is EST but yeah totally understood about full "Eastern"

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jessieay jessieay merged commit 89efa59 into master Apr 12, 2017
@jessieay jessieay deleted the jy-timestamp branch April 12, 2017 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants