[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wikitech-l
Subject:    Re: [Wikitech-l] Time class in MediaWiki?
From:       Nischay Nahata <nischayn22 () gmail ! com>
Date:       2012-12-30 8:16:32
Message-ID: CALFVSbX2NxeM4YGbPjiqj3+SGo8M8gh14CdWM=O77wrEPmeKCA () mail ! gmail ! com
[Download RAW message or body]

On Sunday, December 30, 2012, Brion Vibber wrote:

> On Sat, Dec 29, 2012 at 6:41 AM, Nischay Nahata <nischayn22@gmail.com<javascript:;>
> >wrote:
>
> > I could find a method to covert a timestamp into the user preferred
> > timezone in the Language class; Looks like the wrong place to me.
> > Is there any other way (think global function) to convert to the user's
> > timezone and preferred format?
> >
>
> Date formatting is language-based, so the date formatting functions do
> indeed live in Language. It's also based on user preferences, which makes
> it a bit of an odd fit, but it's a legit localization thing. :)
>
> Elsewhere in the code, timestamps are passed around in timezone-independent
> formats based on UTC.
>
> Also, is there any common script to do this in JS?
> >
> > With reference to bug 43365
> >
>
> I'm not sure if we have full localization for dates in JS...
>
>
Thankfully to the i18n team it seems to be in development now; as per
comment
https://bugzilla.wikimedia.org/show_bug.cgi?id=38079#c5

...but you can use the browser's built-in support. You won't get the same
> formatting, and it may not match the user's *time zone preference* in
> MediaWiki...
>
> eg
>
> https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Date/toLocaleString
>
> -- brion
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org <javascript:;>
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>


-- 
Cheers,

Nischay Nahata
nischayn22.in
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic