sort out dates in js

10.3.x-maintenance
cTn 2014-11-26 16:32:17 +01:00
parent 37003dcb14
commit 277d39109a
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
<span>xx.xx.2014 - 0.57</span>
<span>2014.xx.xx - 0.57</span>
<p>
- Firmware flasher now contains firmware builds picker<br />
- Implemented new and experimental review mechanism<br />

View File

@ -58,7 +58,7 @@ TABS.firmware_flasher.initialize = function (callback) {
// populate select
for (var i = 0; i < releases.length; i++) {
d = new Date(releases[i].time * 1000);
date = ('0' + (d.getDate())).slice(-2) + '.' + ('0' + (d.getMonth() + 1)).slice(-2) + '.' + d.getFullYear();
date = d.getFullYear() + '.' + ('0' + (d.getMonth() + 1)).slice(-2) + '.' + ('0' + (d.getDate())).slice(-2);
date += ' - ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2);
var element = $('<option value="' + i + '">' + (((releases[i].release) ? 'Stable' : 'Dev') + ' ' + date) + '</option>').data('obj', releases[i]);
@ -152,7 +152,7 @@ TABS.firmware_flasher.initialize = function (callback) {
offset = d.getTimezoneOffset() / 60,
date;
date = ('0' + (d.getDate())).slice(-2) + '.' + ('0' + (d.getMonth() + 1)).slice(-2) + '.' + d.getFullYear();
date = d.getFullYear() + '.' + ('0' + (d.getMonth() + 1)).slice(-2) + '.' + ('0' + (d.getDate())).slice(-2);
date += ' @ ' + ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2);
date += (offset > 0) ? ' GMT+' + offset : ' GMT' + offset;