Show exact time of discovery

This commit is contained in:
Michał Gątkowski 2022-08-05 01:17:28 +02:00
parent fd2ee88e5d
commit 69f67d427e

View File

@ -28,7 +28,10 @@ function humaniseDate(unixTime) {
return (new Date(unixTime * 1000)).toLocaleDateString("en-GB", {
day: "2-digit",
month: "2-digit",
year: "numeric"
year: "numeric",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
});
}
@ -70,15 +73,14 @@ Date.prototype.getWeek = function (dowOffset) {
if (day < 4) {
weeknum = Math.floor((daynum + day - 1) / 7) + 1;
if (weeknum > 52) {
nYear = new Date(this.getFullYear() + 1,0,1);
nday = nYear.getDay() - dowOffset;
var nYear = new Date(this.getFullYear() + 1, 0, 1);
var nday = nYear.getDay() - dowOffset;
nday = nday >= 0 ? nday : nday + 7;
/*if the next year starts before the middle of
the week, it is week #1 of that year*/
weeknum = nday < 4 ? 1 : 53;
}
}
else {
} else {
weeknum = Math.floor((daynum + day - 1) / 7);
}
return weeknum;