Skip to content

Commit cc4993c

Browse files
yyyy-mm-dd format
1 parent 4201c1c commit cc4993c

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

evergreen.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ function update_newtab_datetime() {
100100
let da;
101101
if (config["dateformat"] === "md") {
102102
da = `${mo}/${d}/${y}`;
103-
} else {
103+
} else if (config["dateformat"] === "dm") {
104104
da = `${d}/${mo}/${y}`;
105+
} else if (config["dateformat"] === "ymd") {
106+
da = `${y}-${mo.toString().padStart(2, "0")}-${d.toString().padStart(2, "0")}`;
105107
}
106108
set_html_if_needed(qs("#date"), da);
107109
}
@@ -308,8 +310,10 @@ function settings_set_timeformat() {
308310
function settings_set_dateformat() {
309311
if (this.id === "mdradio") {
310312
config["dateformat"] = "md";
311-
} else {
313+
} else if (this.id === "dmradio") {
312314
config["dateformat"] = "dm";
315+
} else if (this.id === "ymdradio") {
316+
config["dateformat"] = "ymd";
313317
}
314318
save_settings();
315319
}
@@ -846,11 +850,14 @@ function init_dateformat() {
846850
}
847851
if (config["dateformat"] === "md") {
848852
qs("#mdradio").setAttribute("checked", "checked");
849-
} else {
853+
} else if (config["dateformat"] === "dm") {
850854
qs("#dmradio").setAttribute("checked", "checked");
855+
} else if (config["dateformat"] === "ymd") {
856+
qs("#ymdradio").setAttribute("checked", "checked");
851857
}
852858
qs('#mdradio').addEventListener('input', settings_set_dateformat);
853859
qs('#dmradio').addEventListener('input', settings_set_dateformat);
860+
qs('#ymdradio').addEventListener('input', settings_set_dateformat);
854861
});
855862
}
856863

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "Evergreen New Tab",
44
"short_name": "Evergreen",
55
"description": "A minimalistic, functional, and beautiful new tab extension for Chrome",
6-
"version": "2.0.0",
6+
"version": "2.1.0",
77
"permissions": [
88
"storage",
99
"geolocation"

newtab.html

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ <h5 class="modal-title"><img alt="" class="logoimg" src="icons/evergreen128.png"
141141
<input class="form-check-input" id="dmradio" name="dateform" type="radio">
142142
<label class="form-check-label" for="dmradio">DD/MM/YYYY</label>
143143
</div>
144+
<div class="form-check form-check-inline">
145+
<input class="form-check-input" id="ymdradio" name="dateform" type="radio">
146+
<label class="form-check-label" for="ymdradio">YYYY-MM-DD</label>
147+
</div>
144148
</div>
145149
<div>
146150
<p><i class="fa-solid fa-cloud-sun-rain"></i> Weather:</p>
@@ -338,20 +342,10 @@ <h4 class="modal-title"><img alt="" class="logoimg" src="icons/evergreen128.png"
338342
</div>
339343
<div class="modal-body">
340344
<!--TODO: changelog-->
341-
<h3>Changelog v2.0.0</h3>
345+
<h3>Changelog v2.1.0</h3>
342346
<h4>Changes</h4>
343347
<ul>
344-
<li>Evergreen is now <a class="whitelink" href="https://github.com/HexCodeFFF/evergreen">open
345-
source!</a></li>
346-
<li>Replaced DarkSky with OpenWeatherMap and the framework to add new weather providers (NWS is planned)</li>
347-
<li>Rewrote large parts of the extension for better performance, cleaner code, and less
348-
dependencies
349-
</li>
350-
<li>added subtle shadows to text to aid readability on bright backgrounds</li>
351-
<li>completely new weather popover UI with chart.js and other nice visuals</li>
352-
<li>weather can now be fetched from a manually defined location</li>
353-
<li>weather fetching can now be entirely disabled</li>
354-
<li>beautified calendar popover</li>
348+
<li>Added YYYY-MM-DD date format option.</li>
355349
</ul>
356350
</div>
357351
<div class="modal-footer">

0 commit comments

Comments
 (0)