-
-
Save freshlogic/57d813c496ca808e9c2f to your computer and use it in GitHub Desktop.
timezones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before: | |
<% var daysOld = moment(new Date()).diff(moment(account.createdAt), 'days') + 1; %> | |
<%= account.username %> joined us <%= pluralize('day', daysOld, true) %> ago on <%= moment.tz(account.createdAt, 'America/New_York').format('MMMM Do, YYYY') %>. | |
After: | |
<% var daysOld = moment.tz(new Date(), 'America/New_York').startOf('day').diff(moment.tz(account.createdAt, 'America/New_York').startOf('day'), 'days') + 1; %> | |
<%= account.username %> joined us <%= pluralize('day', daysOld, true) %> ago on <%= moment.tz(account.createdAt, 'America/New_York').format('MMMM Do, YYYY') %>. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment