fix localized am/pm
This commit is contained in:
parent
c2d993adcd
commit
5eed80ae7d
11
4chan_x.js
11
4chan_x.js
@ -1651,16 +1651,17 @@
|
|||||||
year = "20" + year;
|
year = "20" + year;
|
||||||
month -= 1;
|
month -= 1;
|
||||||
hour = g.chanOffset + Number(hour);
|
hour = g.chanOffset + Number(hour);
|
||||||
|
date = new Date(year, month, day, hour);
|
||||||
|
year = date.getFullYear() - 2000;
|
||||||
|
month = $.zeroPad(date.getMonth() + 1);
|
||||||
|
day = $.zeroPad(date.getDate());
|
||||||
|
hour = date.getHours();
|
||||||
meridiem = '';
|
meridiem = '';
|
||||||
if ($.config('Localized am/pm')) {
|
if ($.config('Localized am/pm')) {
|
||||||
meridiem = hour < 12 ? ' a.m.' : ' p.m.';
|
meridiem = hour < 12 ? ' a.m.' : ' p.m.';
|
||||||
hour = hour % 12 || 12;
|
hour = hour % 12 || 12;
|
||||||
}
|
}
|
||||||
date = new Date(year, month, day, hour);
|
hour = $.zeroPad(hour);
|
||||||
year = date.getFullYear() - 2000;
|
|
||||||
month = $.zeroPad(date.getMonth() + 1);
|
|
||||||
day = $.zeroPad(date.getDate());
|
|
||||||
hour = $.zeroPad(date.getHours());
|
|
||||||
dotw = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][date.getDay()];
|
dotw = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][date.getDay()];
|
||||||
_results.push(s.textContent = " " + month + "/" + day + "/" + year + "(" + dotw + ")" + hour + ":" + min_sec + meridiem + " ");
|
_results.push(s.textContent = " " + month + "/" + day + "/" + year + "(" + dotw + ")" + hour + ":" + min_sec + meridiem + " ");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1330,15 +1330,16 @@ localize =
|
|||||||
year = "20#{year}"
|
year = "20#{year}"
|
||||||
month -= 1 #months start at 0
|
month -= 1 #months start at 0
|
||||||
hour = g.chanOffset + Number hour
|
hour = g.chanOffset + Number hour
|
||||||
meridiem = ''
|
|
||||||
if $.config 'Localized am/pm'
|
|
||||||
meridiem = if hour < 12 then ' a.m.' else ' p.m.'
|
|
||||||
hour = hour % 12 or 12
|
|
||||||
date = new Date year, month, day, hour
|
date = new Date year, month, day, hour
|
||||||
year = date.getFullYear() - 2000
|
year = date.getFullYear() - 2000
|
||||||
month = $.zeroPad date.getMonth() + 1
|
month = $.zeroPad date.getMonth() + 1
|
||||||
day = $.zeroPad date.getDate()
|
day = $.zeroPad date.getDate()
|
||||||
hour = $.zeroPad date.getHours()
|
hour = date.getHours()
|
||||||
|
meridiem = ''
|
||||||
|
if $.config 'Localized am/pm'
|
||||||
|
meridiem = if hour < 12 then ' a.m.' else ' p.m.'
|
||||||
|
hour = hour % 12 or 12
|
||||||
|
hour = $.zeroPad hour
|
||||||
dotw = [
|
dotw = [
|
||||||
'Sun'
|
'Sun'
|
||||||
'Mon'
|
'Mon'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user