urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

amTimeAgo title and innerText inconsistancy #225

Open stackia opened 8 years ago

stackia commented 8 years ago

If moment-timezone is enabled, and set angularMomentConfig.timezone to some timezone, when the browser local timezone is not the same with angularMomentConfig.timezone, amTimeAgo will give different text on element's title and innerText (full date format).

Problem is caused by the '.local()' here: https://github.com/urish/angular-moment/blob/master/angular-moment.js#L233 https://github.com/urish/angular-moment/blob/master/angular-moment.js#L239

They should both use '.local()' or neither. May be it's better to give an 'alwaysLocalTimezone' option?

urish commented 8 years ago

I think it makes more sense to simply remove the .local() at the second location. We have the amLocal filter that the library users can utilize for this purpose.

Any chance you could send a pull request with this change?

Thanks!