dev #160

Merged
sora merged 97 commits from dev into master 2025-03-02 01:09:30 +01:00
Showing only changes of commit d295c15504 - Show all commits

View File

@ -2,8 +2,10 @@
declare global { declare global {
interface Date { interface Date {
toJSONLocal: () => string; toJSONLocal: () => string;
toLocal: () => string;
} }
} }
Date.prototype.toJSONLocal = function () { Date.prototype.toJSONLocal = function () {
function addZ(n: number): string { function addZ(n: number): string {
return n <= 9 ? `0${n}` : `${n}`; return n <= 9 ? `0${n}` : `${n}`;
@ -13,7 +15,27 @@ Date.prototype.toJSONLocal = function () {
addZ(this.getMonth() + 1), addZ(this.getMonth() + 1),
addZ(this.getDate()), addZ(this.getDate()),
].join("-"); ].join("-");
}; }
Date.prototype.toLocal = function () {
return [["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][this.getDay()],
this.getDate(),
[
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
][this.getMonth()]].join(" ")
;
}
// ARRAY EXTENTION // ARRAY EXTENTION
declare global { declare global {