Compare commits

..

No commits in common. "master" and "dtime-js" have entirely different histories.

4 changed files with 24 additions and 39 deletions

View File

@ -9,4 +9,4 @@ https://en.wikipedia.org/wiki/Discordian_calendar
Discordian time is the decimal time without time zones, where the
beginning of the day coincides with the beginning of the Christian
winter day on Easter Island (UTC-5):
https://discordia.fandom.com/wiki/Erisian_Time
https://en.wikipedia.org/wiki/Decimal_time

View File

@ -7,12 +7,9 @@ html {
width: 100%;
height: 100%;
position: relative;
font-size: 55px;
}
body {
background: #f1f1f1;
color: #326f0c;
font-size: 55px;
}
#wrap {

View File

@ -92,15 +92,17 @@ function dtime(gregorianDate,resultar="default") {
} else {
var ddatestr = M+" "+az(D)+", "+Y+" YOLD";
}
var christianMSDay = date.valueOf() % 86400000;
var ds = (christianMSDay/864);
var h = Math.floor(ds/10000);
var h = date.getUTCHours();
var m = date.getUTCMinutes();
var s = date.getUTCSeconds();
var ms = date.getUTCMilliseconds();
var e = h*3600000+m*60000+s*1000+ms;
var ds = Math.round(e/864);
h = Math.floor(ds/10000);
ds%= 10000;
var m = Math.floor(ds/100);
m = Math.floor(ds/100);
ds%= 100;
var s = Math.floor(ds);
s = ds;
switch (resultar) {
case "shortsec":
return [ddatestr, h+":"+az(m), ":"+az(s), ddaystr];
@ -137,24 +139,24 @@ function dday(day, season, yearday, sttiby) {
else if (season == 0 && day == 17) ddaystr += ", Celebrate Joshmas";
else if (season == 0 && day == 18) ddaystr += ", Celebrate Pat Pineapple Day";
else if (season == 0 && day == 21) ddaystr += ", Celebrate Hug Day";
else if (season == 0 && day == 26) ddaystr += ", Celebrate yaD sdrawkcaB, Traditional";
else if (season == 0 && day == 37) ddaystr += ", Celebrate Aaron Burr's Birthday";
else if (season == 0 && day == 26) ddaystr += ", Celebrate Backwards Day, Traditional";
else if (season == 0 && day == 37) ddaystr += ", Celebrate Aaron Burrs Birthday";
else if (season == 0 && day == 51) ddaystr += ", Celebrate Pet Loving Day";
else if (season == 0 && day == 69) ddaystr += ", Celebrate Chicken Head Day";
else if (season == 0 && day == 72) ddaystr += ", Celebrate Daytime";
else if (season == 1 && day == 4) ddaystr += ", Celebrate Grover Cleveland's Birthday";
else if (season == 1 && day == 4) ddaystr += ", Celebrate Grover Clevelands Birthday";
else if (season == 1 && day == 11) ddaystr += ", Celebrate Discordians for Jesus/Love Your Neighbor Day";
else if (season == 1 && day == 18) ddaystr += ", Celebrate Fool's Day";
else if (season == 1 && day == 19) ddaystr += ", Celebrate St. John the Blasphemist's Day";
else if (season == 1 && day == 18) ddaystr += ", Celebrate Fools Day";
else if (season == 1 && day == 19) ddaystr += ", Celebrate St. John the Blasphemists Day";
else if (season == 1 && day == 34) ddaystr += ", Celebrate Omarmas";
else if (season == 1 && day == 43) ddaystr += ", Celebrate Universal Ordination Day";
else if (season == 1 && day == 68) ddaystr += ", Celebrate Mal-2mas";
else if (season == 1 && day == 70) ddaystr += ", Celebrate Day of the Elppin/Defenestration of Prague Day";
else if (season == 1 && day == 70) ddaystr += ", Celebrate Jake Day Jr./Day of the Elppin";
else if (season == 1 && day == 72) ddaystr += ", Celebrate Towel Day";
else if (season == 2 && day == 26) ddaystr += ", Celebrate Imaginary Friend Day";
else if (season == 2 && day == 28) ddaystr += ", Celebrate St. George's Day";
else if (season == 2 && day == 28) ddaystr += ", Celebrate St. Georges Day";
else if (season == 2 && day == 30) ddaystr += ", Celebrate Zoog Day";
else if (season == 2 && day == 37) ddaystr += ", Celebrate Mid-Year's Day";
else if (season == 2 && day == 37) ddaystr += ", Celebrate Mid-Years Day";
else if (season == 2 && day == 40) ddaystr += ", Celebrate X-Day";
else if (season == 2 && day == 55) ddaystr += ", Celebrate Mal-2 Day";
else if (season == 2 && day == 57) ddaystr += ", Celebrate John Dillinger Day";

View File

@ -2,19 +2,15 @@
* https://gitlab.com/zlax/dtime-js discrodian date and time converter
*/
function showconv() {
document.getElementById("dconv").innerHTML = converterhtml();
var currentdate = new Date();
document.getElementById("ctimeoffset").value = currentdate.getTimezoneOffset();
filltimes(currentdate);
}
function timeclick() {
function timeclick () {
if (window.dtimescreen) window.dtimescreen++;
else window.dtimescreen = 1;
switch (window.dtimescreen) {
case 1:
showconv();
document.getElementById("dconv").innerHTML = converterhtml();
var currentdate = new Date();
document.getElementById("ctimeoffset").value = currentdate.getTimezoneOffset();
filltimes(currentdate);
break;
case 2:
document.getElementById("dconv").innerHTML = "";
@ -149,13 +145,3 @@ function converterhtml() {
`;
return convinnerhtml;
}
document.addEventListener("DOMContentLoaded", function() {
if (window.location.hash == "#c" || window.location.hash == "#conv" || window.location.hash == "#converter") {
window.dtimescreen = 1;
showconv();
}
if (window.location.hash == "#d" || window.location.hash == "#dark") {
document.body.style.background = '#2e3235';
}
});