a5d38e7fbc
- Protect author's location privacy - Reduce locale configuration parameters
20 lines
564 B
JavaScript
20 lines
564 B
JavaScript
/**
|
|
* Update month/day to locale datetime
|
|
*
|
|
* Requirement: <https://github.com/iamkun/dayjs>
|
|
*/
|
|
|
|
$(function() {
|
|
dayjs.locale(LocaleHelper.locale());
|
|
dayjs.extend(window.dayjs_plugin_localizedFormat);
|
|
|
|
$(`[${LocaleHelper.attrTimestamp()}]`).each(function () {
|
|
const date = dayjs.unix(LocaleHelper.getTimestamp($(this)));
|
|
const df = LocaleHelper.getDateFormat($(this));
|
|
const text = date.format(df);
|
|
|
|
$(this).text(text);
|
|
$(this).removeAttr(LocaleHelper.attrTimestamp());
|
|
$(this).removeAttr(LocaleHelper.attrDateFormat());
|
|
});
|
|
});
|