line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# This file is generated by author/assets.pl. Do not edit manually. |
2
|
|
|
|
|
|
|
package Amon2::Setup::Asset::StrftimeJS; |
3
|
1
|
|
|
1
|
|
370
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
174
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub tags { |
7
|
1
|
|
|
1
|
0
|
4
|
<<',,,'; |
8
|
|
|
|
|
|
|
<script src="<: uri_for('/static/js/strftime.js') :>"></script> |
9
|
|
|
|
|
|
|
,,, |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub files { |
13
|
|
|
|
|
|
|
return { |
14
|
0
|
|
|
0
|
0
|
|
'js/strftime.js' => "// version 0.11 by Daniel Rench |
15
|
|
|
|
|
|
|
// More information: http://dren.ch/strftime/ |
16
|
|
|
|
|
|
|
// This is public domain software |
17
|
|
|
|
|
|
|
// |
18
|
|
|
|
|
|
|
// Some modification by tokuhirom. |
19
|
|
|
|
|
|
|
// Tokuhirom's modifications are public domain, too. |
20
|
|
|
|
|
|
|
(function () { |
21
|
|
|
|
|
|
|
\"use strict\"; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
function pad (d, n, p) { |
24
|
|
|
|
|
|
|
var s = '' + d; |
25
|
|
|
|
|
|
|
p = p || '0'; |
26
|
|
|
|
|
|
|
while (s.length < n) s = p + s; |
27
|
|
|
|
|
|
|
return s; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
var locales = { |
31
|
|
|
|
|
|
|
en: { |
32
|
|
|
|
|
|
|
A: [ |
33
|
|
|
|
|
|
|
'Sunday', 'Monday', 'Tuesday', 'Wednesday', |
34
|
|
|
|
|
|
|
'Thursday', 'Friday', 'Saturday' |
35
|
|
|
|
|
|
|
], |
36
|
|
|
|
|
|
|
a: [ |
37
|
|
|
|
|
|
|
\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" |
38
|
|
|
|
|
|
|
], |
39
|
|
|
|
|
|
|
B: [ |
40
|
|
|
|
|
|
|
'January', 'February', 'March', 'April', 'May', 'June', 'July', |
41
|
|
|
|
|
|
|
'August', 'September', 'October', 'November', 'December' |
42
|
|
|
|
|
|
|
], |
43
|
|
|
|
|
|
|
b: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"] |
44
|
|
|
|
|
|
|
}, |
45
|
|
|
|
|
|
|
ja: { |
46
|
|
|
|
|
|
|
B: [\" 1\x{6708}\", \" 2\x{6708}\", \" 3\x{6708}\", \" 4\x{6708}\", \" 5\x{6708}\", \" 6\x{6708}\", \" 7\x{6708}\", \" 8\x{6708}\", \" 9\x{6708}\", \"10\x{6708}\", \"11\x{6708}\", \"12\x{6708}\"], |
47
|
|
|
|
|
|
|
b: [\" 1\x{6708}\", \" 2\x{6708}\", \" 3\x{6708}\", \" 4\x{6708}\", \" 5\x{6708}\", \" 6\x{6708}\", \" 7\x{6708}\", \" 8\x{6708}\", \" 9\x{6708}\", \"10\x{6708}\", \"11\x{6708}\", \"12\x{6708}\"], |
48
|
|
|
|
|
|
|
A: [\"\x{65e5}\x{66dc}\x{65e5}\", \"\x{6708}\x{66dc}\x{65e5}\", \"\x{706b}\x{66dc}\x{65e5}\", \"\x{6c34}\x{66dc}\x{65e5}\", \"\x{6728}\x{66dc}\x{65e5}\", \"\x{91d1}\x{66dc}\x{65e5}\", \"\x{571f}\x{66dc}\x{65e5}\"], |
49
|
|
|
|
|
|
|
a: [\"\x{65e5}\", \"\x{6708}\", \"\x{706b}\", \"\x{6c34}\", \"\x{6728}\", \"\x{91d1}\", \"\x{571f}\"] |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
}; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
var formats = { |
54
|
|
|
|
|
|
|
A: function (d, locale) { return locales[locale].A[d.getDay()]; }, |
55
|
|
|
|
|
|
|
a: function (d, locale) { return locales[locale].a[d.getDay()]; }, |
56
|
|
|
|
|
|
|
B: function (d, locale) { return locales[locale].B[d.getMonth()]; }, |
57
|
|
|
|
|
|
|
b: function (d, locale) { return locales[locale].b[d.getMonth()]; }, |
58
|
|
|
|
|
|
|
C: function (d) { return Math.floor(d.getFullYear()/100); }, |
59
|
|
|
|
|
|
|
c: function (d) { return d.toString(); }, |
60
|
|
|
|
|
|
|
D: function (d) { |
61
|
|
|
|
|
|
|
return formats.m(d) + '/' + |
62
|
|
|
|
|
|
|
formats.d(d) + '/' + formats.y(d); |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
d: function (d) { return pad(d.getDate(), 2,'0'); }, |
65
|
|
|
|
|
|
|
e: function (d) { return pad(d.getDate(), 2,' '); }, |
66
|
|
|
|
|
|
|
F: function (d) { |
67
|
|
|
|
|
|
|
return formats.Y(d) + '-' + formats.m(d) + '-' + |
68
|
|
|
|
|
|
|
formats.d(d); |
69
|
|
|
|
|
|
|
}, |
70
|
|
|
|
|
|
|
H: function (d) { return pad(d.getHours(), 2,'0'); }, |
71
|
|
|
|
|
|
|
I: function (d) { return pad((d.getHours() % 12 || 12), 2); }, |
72
|
|
|
|
|
|
|
/* |
73
|
|
|
|
|
|
|
%g |
74
|
|
|
|
|
|
|
like %G, but without the century |
75
|
|
|
|
|
|
|
%G |
76
|
|
|
|
|
|
|
The 4-digit year corresponding to the ISO week number |
77
|
|
|
|
|
|
|
%j |
78
|
|
|
|
|
|
|
day of the year as a decimal number (range 001 to 366) |
79
|
|
|
|
|
|
|
%U |
80
|
|
|
|
|
|
|
week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week |
81
|
|
|
|
|
|
|
%V |
82
|
|
|
|
|
|
|
The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. |
83
|
|
|
|
|
|
|
%W |
84
|
|
|
|
|
|
|
week number of the current year as a decimal number, starting with the first Monday as the first day of the first week |
85
|
|
|
|
|
|
|
%Z |
86
|
|
|
|
|
|
|
time zone name or abbreviation |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
j: function (d) { |
89
|
|
|
|
|
|
|
var t = d.getDate(); |
90
|
|
|
|
|
|
|
var m = d.getMonth() - 1; |
91
|
|
|
|
|
|
|
if (m > 1) { |
92
|
|
|
|
|
|
|
var y = d.getYear(); |
93
|
|
|
|
|
|
|
if (((y % 100) == 0) && ((y % 400) == 0)) ++t; |
94
|
|
|
|
|
|
|
else if ((y % 4) == 0) ++t; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
while (m > -1) t += d.dpm[m--]; |
97
|
|
|
|
|
|
|
return t.pad(3,'0'); |
98
|
|
|
|
|
|
|
}, |
99
|
|
|
|
|
|
|
*/ |
100
|
|
|
|
|
|
|
k: function (d) { return pad(d.getHours(), 2,' '); }, |
101
|
|
|
|
|
|
|
l: function (d) { return pad((d.getHours() % 12 || 12), 2,' '); }, |
102
|
|
|
|
|
|
|
M: function (d) { return pad(d.getMinutes(), 2,'0'); }, |
103
|
|
|
|
|
|
|
m: function (d) { return pad((d.getMonth()+1), 2,'0'); }, |
104
|
|
|
|
|
|
|
n: function (d) { return \"\\n\"; }, |
105
|
|
|
|
|
|
|
p: function (d) { return (d.getHours() > 11) ? 'PM' : 'AM'; }, |
106
|
|
|
|
|
|
|
P: function (d) { return formats.p(d).toLowerCase(); }, |
107
|
|
|
|
|
|
|
R: function (d) { return formats.H(d) + ':' + formats.M(d); }, |
108
|
|
|
|
|
|
|
r: function (d) { |
109
|
|
|
|
|
|
|
return formats.I(d) + ':' + formats.M(d) + ':' + |
110
|
|
|
|
|
|
|
formats.S(d) + ' ' + formats.p(d); |
111
|
|
|
|
|
|
|
}, |
112
|
|
|
|
|
|
|
S: function (d) { return pad(d.getSeconds(), 2,'0'); }, |
113
|
|
|
|
|
|
|
s: function (d) { return Math.floor(d.getTime()/1000); }, |
114
|
|
|
|
|
|
|
T: function (d) { |
115
|
|
|
|
|
|
|
return formats.H(d) + ':' + formats.M(d) + ':' + |
116
|
|
|
|
|
|
|
formats.S(d); |
117
|
|
|
|
|
|
|
}, |
118
|
|
|
|
|
|
|
t: function (d) { return \"\\t\"; }, |
119
|
|
|
|
|
|
|
/* U: function (d) { return false; }, */ |
120
|
|
|
|
|
|
|
u: function (d) { return(d.getDay() || 7); }, |
121
|
|
|
|
|
|
|
/* V: function (d) { return false; }, */ |
122
|
|
|
|
|
|
|
v: function (d) { |
123
|
|
|
|
|
|
|
return formats.e(d) + '-' + formats.b(d) + '-' + |
124
|
|
|
|
|
|
|
formats.Y(d); |
125
|
|
|
|
|
|
|
}, |
126
|
|
|
|
|
|
|
/* W: function (d) { return false; }, */ |
127
|
|
|
|
|
|
|
w: function (d) { return d.getDay(); }, |
128
|
|
|
|
|
|
|
X: function (d) { return d.toTimeString(); }, // wrong? |
129
|
|
|
|
|
|
|
x: function (d) { return d.toDateString(); }, // wrong? |
130
|
|
|
|
|
|
|
Y: function (d) { return d.getFullYear(); }, |
131
|
|
|
|
|
|
|
y: function (d) { return pad((d.getYear() % 100), 2); }, |
132
|
|
|
|
|
|
|
// Z: function (d) { return d.toString().match(/\\((.+)\\)\$/)[1]; }, |
133
|
|
|
|
|
|
|
// z: function (d) { return d.getTimezoneOffset(); }, // wrong |
134
|
|
|
|
|
|
|
// z: function (d) { return d.toString().match(/\\sGMT([+-]\\d+)/)[1]; }, |
135
|
|
|
|
|
|
|
'%': function (d) { return '%'; } |
136
|
|
|
|
|
|
|
}; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
formats['+'] = formats.c; |
139
|
|
|
|
|
|
|
formats.h = formats.b; |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
var defaultLocale = 'en'; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
function strftime(date, fmt, locale) { |
144
|
|
|
|
|
|
|
var r = ''; |
145
|
|
|
|
|
|
|
var n = 0; |
146
|
|
|
|
|
|
|
if (!locale) { locale = defaultLocale; } |
147
|
|
|
|
|
|
|
while(n < fmt.length) { |
148
|
|
|
|
|
|
|
var c = fmt.substring(n, n+1); |
149
|
|
|
|
|
|
|
if (c == '%') { |
150
|
|
|
|
|
|
|
c = fmt.substring(++n, n+1); |
151
|
|
|
|
|
|
|
r += (formats[c]) ? formats[c](date, locale) : c; |
152
|
|
|
|
|
|
|
} else r += c; |
153
|
|
|
|
|
|
|
++n; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
return r; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Date.prototype.strftime = function (fmt, locale) { |
159
|
|
|
|
|
|
|
return strftime(this, fmt, locale); |
160
|
|
|
|
|
|
|
}; |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
Date.prototype.strftime.formats = formats; |
163
|
|
|
|
|
|
|
Date.prototype.strftime.setDefaultLocale = function (locale) { |
164
|
|
|
|
|
|
|
defaultLocale = locale; |
165
|
|
|
|
|
|
|
}; |
166
|
|
|
|
|
|
|
Date.prototype.strftime.locales = locales; |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
})(); |
169
|
|
|
|
|
|
|
" |
170
|
|
|
|
|
|
|
} |
171
|
|
|
|
|
|
|
; |
172
|
|
|
|
|
|
|
} |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
1; |