jquery-timeago icon indicating copy to clipboard operation
jquery-timeago copied to clipboard

Add setting to pass options for date.toLocaleString()

Open ghost opened this issue 6 years ago • 0 comments
trafficstars

I personally don't like the format that toLocaleString() returns (24/10/2019 2:36:56).

It would be nice if there was an option to pass its options like dateStyle: 'long', timeStyle: 'short', etc.

e.g.

$.timeago.settings.LocaleFormat = {dateStyle: 'medium', timeStyle: 'short', hour12: true};
// $(this).attr("title", date.toLocaleString(undefined, $t.settings.LocaleFormat));

will show as Oct 8, 2019, 2:36 AM

ghost avatar Oct 24 '19 21:10 ghost