Reverted date format changes.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2025-05-25 00:11:09 +03:00
parent fc31eeca88
commit 1979b1692d
3 changed files with 90 additions and 141 deletions

View file

@ -1,17 +1,6 @@
import { ReactiveCache } from '/imports/reactiveCache';
import { Session } from 'meteor/session';
import { FlowRouter } from 'meteor/kadira:flow-router';
import { Tracker } from 'meteor/tracker';
import { $ } from 'meteor/jquery';
import { Meteor } from 'meteor/meteor';
// Initialize global Utils first
if (typeof window.Utils === 'undefined') {
window.Utils = {};
}
// Create Utils object
const Utils = {
Utils = {
setBackgroundImage(url) {
const currentBoard = Utils.getCurrentBoard();
if (currentBoard.backgroundImageURL !== undefined) {
@ -26,19 +15,12 @@ const Utils = {
// This helps with date parsing in non-English languages
normalizeDigits(str) {
if (!str) return str;
// Convert Persian and Arabic numbers to English
const persianNumbers = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
const arabicNumbers = ['٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩'];
return str.split('')
.map(c => {
const pIndex = persianNumbers.indexOf(c);
const aIndex = arabicNumbers.indexOf(c);
if (pIndex >= 0) return pIndex.toString();
if (aIndex >= 0) return aIndex.toString();
return c;
})
.join('');
const persian = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
const arabic = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
for (let i = 0; i < 10; i++) {
str = str.replace(persian[i], i).replace(arabic[i], i);
}
return str;
},
/** returns the current board id
* <li> returns the current board id or the board id of the popup card if set
@ -609,12 +591,6 @@ const Utils = {
},
};
// Update global Utils with all methods
Object.assign(window.Utils, Utils);
// Export for ES modules
export { Utils };
// A simple tracker dependency that we invalidate every time the window is
// resized. This is used to reactively re-calculate the popup position in case
// of a window resize. This is the equivalent of a "Signal" in some other