feat: closes #12123, allow setting hh:mm for pin expiry

use locale for pin expiry and use short form
This commit is contained in:
Barış Soner Uşaklı
2023-10-26 11:14:58 -04:00
parent 668a355afe
commit 1f8007476c
4 changed files with 20 additions and 15 deletions

View File

@@ -343,8 +343,11 @@ module.exports = function (utils, Benchpress, relative_path) {
return `[[topic:wrote-${langSuffix}, ${relative_path}/post/${post.pid}, ${post.timestampISO}]]`;
}
function isoTimeToLocaleString(isoTime) {
return new Date(isoTime).toLocaleString().replace(/,/g, ',');
function isoTimeToLocaleString(isoTime, locale = 'en-GB') {
return new Date(isoTime).toLocaleString([locale], {
dateStyle: 'short',
timeStyle: 'short',
}).replace(/,/g, ',');
}
function shouldHideReplyContainer(post) {