javascript - AngularJS global Date timezone offset -


I'm looking at users to show dates relative to their timezone.

I hope that the Connection is filtered by Date to configure it globally - doing so manually on a case-by-case basis It seems wrong to do

My timestamps are already wrapped in a timestamp () function (just to multiply by 1000), but I do not want to modify that function if I < Em> does not

Edit:

I am doing this, and it works, but as above, I want to set it up if If possible, a level high

  $ scope.timestamp = function (unix_time) {var epoch = (unix_time * 1000); Var Date = New Date (); Var localoffice = (-1) * date.getTimezoneOffset () * 60000; Var stamp = Math.round (new date (era + local offset) .gettime ()); Return stamp; };  

So, thanks for the change in angular 1.4.x it's now trivial to handle it The right way to make a decorator will be that before it turns into a filter created when making the run. It is very easy, and there will be no effect on the performance.

This is one I use if no timezone is specified then it only adds DEFAULT_TIMEZONE. The effect of running all the dates of the app in GMT is done until no other time zone is given.

module.config (['$ Provide', provide function ($ rendered) {var DEFAULT_TIMEZONE = 'GMT'; $. The cursor ('datfilter', ['$ representative', ' $ Injector ', function ($ representative, $ injector) {var old delicate = $ representative; var standard datafitter interceptor = function (date, format, timezone) {If (angular.isUndefined (timezone)) {timezone = DEFAULT_TIMEZONE}} Return Freedom. (It, [Date, Format, Timezone]);}; Standard; DataFilter Interceptor Return;}]);}]);

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -