urish / angular-moment

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

Setting a "from" and a "to" timezone? #165

Closed antony-k1208 closed 9 years ago

antony-k1208 commented 9 years ago

Hey guys,

im wondering if it is somehow possible to use a "from" timezone and "to" timezone. Im using Timezones from "Europe/London" and want to use the amTimeAgo directive to show the user the difference in its specific timezone, i.e. "America/Los_Angeles".

Im using the following format im by database: 2015-08-23 21:22:28

Im really thankful for any help!

urish commented 9 years ago

@ThinklabsGbR this should be achievable by setting the angularMomentConfig.timezone to Europe/London, e.g.

angular.module('myapp').config(function(angularMomentConfig) {
    angularMomentConfig.timezone = 'Europe/London';
});

am-time-ago should automatically display the relative date based on the user's machine time, and it should take into account his locally configured timezone.

Please re-open if further discussion / assistance is required. Thanks!