Server IP : 184.154.167.98 / Your IP : 3.144.255.247 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/public_html/fotografico/apps/logreader/js/ |
Upload File : |
/* * PHP => moment.js * * http://www.php.net/manual/en/function.date.php * http://momentjs.com/docs/#/displaying/format/ * https://gist.github.com/NTICompass/9375143 */ const formatMap = { d: 'DD', D: 'ddd', j: 'D', l: 'dddd', N: 'E', w: 'd', W: 'W', F: 'MMMM', m: 'MM', M: 'MMM', n: 'M', o: 'GGGG', Y: 'YYYY', y: 'YY', a: 'a', A: 'A', g: 'h', G: 'H', h: 'hh', H: 'HH', i: 'mm', s: 'ss', u: '[u]', // not sure if moment has this e: '[e]', // moment does not have this O: 'ZZ', P: 'Z', T: '\T', // deprecated in moment c: 'YYYY-MM-DD[T]HH:mm:ssZ', r: 'ddd, DD MMM YYYY HH:mm:ss ZZ', U: 'X' }; const formatEx = /[dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZcrU]/g; export function convertDateFormat (format) { return format.replace(formatEx, (phpStr) => { return typeof formatMap[phpStr] === 'function' ? formatMap[phpStr]() : formatMap[phpStr]; }); }