Improve markdown editor
This commit is contained in:
17
assets/editor/dates.js
Normal file
17
assets/editor/dates.js
Normal file
@@ -0,0 +1,17 @@
|
||||
window.EditorDates = (function () {
|
||||
|
||||
function pad2(n) { return n < 10 ? '0' + n : '' + n; }
|
||||
|
||||
function isoDate() {
|
||||
var d = new Date();
|
||||
return d.getFullYear() + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate());
|
||||
}
|
||||
|
||||
function longDate() {
|
||||
return new Date().toLocaleDateString('de-DE', {
|
||||
weekday: 'long', year: 'numeric', month: 'long', day: 'numeric'
|
||||
});
|
||||
}
|
||||
|
||||
return { isoDate: isoDate, longDate: longDate };
|
||||
})();
|
||||
Reference in New Issue
Block a user