Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
use PHP date format for calendar field
Browse files Browse the repository at this point in the history
  • Loading branch information
uyab committed Oct 18, 2019
1 parent 698a1d1 commit aa0e6a4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion public/js/all.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"/css/app.css": "/css/app.css?id=9ccf21a457016100da27",
"/js/all.js": "/js/all.js?id=b5258adb154d8a6b81e5",
"/js/all.js": "/js/all.js?id=bb072114bd0c5b170bc8",
"/css/all.css": "/css/all.css?id=7b2e7f4696f2d3bf19b0",
"/semantic/semantic.min.css": "/semantic/semantic.min.css?id=395cd6af3c3778570b67"
}
31 changes: 27 additions & 4 deletions resources/js/init/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,36 @@ $(function () {
if (!date) {
return '';
}
var DD = ("0" + date.getDate()).slice(-2);
var MM = ("0" + (date.getMonth() + 1)).slice(-2);
var MMMM = settings.text.months[date.getMonth()];
var h = date.getHours();
var i = date.getMinutes();
var s = date.getSeconds();
var j = date.getDate();
var DD = d = ("0" + date.getDate()).slice(-2);
var n = date.getMonth() + 1;
var MM = m = ("0" + (date.getMonth() + 1)).slice(-2);
var MMMM = F = settings.text.months[date.getMonth()];
var M = settings.text.monthsShort[date.getMonth()];
var YY = date.getFullYear().toString().substr(2, 2);
var y = date.getFullYear().toString().substr(2, 2);
var Y = date.getFullYear();
var YYYY = date.getFullYear();

return format.replace('DD', DD).replace('MMMM', MMMM).replace('MM', MM).replace('YYYY', YYYY).replace('YY', YY);
return format
// .replace('h', h)
// .replace('i', i)
// .replace('s', s)
.replace('j', j)
.replace('d', d)
.replace('n', n)
.replace('m', m)
.replace('F', F)
.replace('M', M)
.replace('Y', Y)
.replace('DD', DD)
.replace('MMMM', MMMM)
.replace('MM', MM)
.replace('YYYY', YYYY)
.replace('YY', YY);
}
}
})
Expand Down

0 comments on commit aa0e6a4

Please sign in to comment.