Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
94d6f5e2
Commit
94d6f5e2
authored
May 20, 2020
by
陈超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A
parent
efac865e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
+32
-15
addons/theme/stv1/_static_w3g/js/extension.js
+32
-15
No files found.
addons/theme/stv1/_static_w3g/js/extension.js
View file @
94d6f5e2
...
...
@@ -141,19 +141,35 @@ Array.prototype.hx_lastIndex = function() {
Date
.
prototype
.
format
=
function
(
fmt
)
{
//author: meizz
var
o
=
{
"M+"
:
this
.
getMonth
()
+
1
,
//月份
"d+"
:
this
.
getDate
(),
//日
"h+"
:
this
.
getHours
(),
//小时
"m+"
:
this
.
getMinutes
(),
//分
"s+"
:
this
.
getSeconds
(),
//秒
"q+"
:
Math
.
floor
((
this
.
getMonth
()
+
3
)
/
3
),
//季度
"S"
:
this
.
getMilliseconds
()
//毫秒
};
if
(
/
(
y+
)
/
.
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
this
.
getFullYear
()
+
""
).
substr
(
4
-
RegExp
.
$1
.
length
));
for
(
var
k
in
o
)
if
(
new
RegExp
(
"("
+
k
+
")"
).
test
(
fmt
))
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
RegExp
.
$1
.
length
==
1
)
?
(
o
[
k
])
:
((
"00"
+
o
[
k
]).
substr
((
""
+
o
[
k
]).
length
)));
return
fmt
;
var
o
=
{
"M+"
:
this
.
getMonth
()
+
1
,
//月份
"d+"
:
this
.
getDate
(),
//日
"h+"
:
this
.
getHours
()
%
12
==
0
?
12
:
this
.
getHours
()
%
12
,
//小时
"H+"
:
this
.
getHours
(),
//小时
"m+"
:
this
.
getMinutes
(),
//分
"s+"
:
this
.
getSeconds
(),
//秒
"q+"
:
Math
.
floor
((
this
.
getMonth
()
+
3
)
/
3
),
//季度
"S"
:
this
.
getMilliseconds
()
//毫秒
};
var
week
=
{
"0"
:
"/u65e5"
,
"1"
:
"/u4e00"
,
"2"
:
"/u4e8c"
,
"3"
:
"/u4e09"
,
"4"
:
"/u56db"
,
"5"
:
"/u4e94"
,
"6"
:
"/u516d"
};
if
(
/
(
y+
)
/
.
test
(
fmt
)){
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
this
.
getFullYear
()
+
""
).
substr
(
4
-
RegExp
.
$1
.
length
));
}
if
(
/
(
E+
)
/
.
test
(
fmt
)){
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
((
RegExp
.
$1
.
length
>
1
)
?
(
RegExp
.
$1
.
length
>
2
?
"/u661f/u671f"
:
"/u5468"
)
:
""
)
+
week
[
this
.
getDay
()
+
""
]);
}
for
(
var
k
in
o
){
if
(
new
RegExp
(
"("
+
k
+
")"
).
test
(
fmt
)){
fmt
=
fmt
.
replace
(
RegExp
.
$1
,
(
RegExp
.
$1
.
length
==
1
)
?
(
o
[
k
])
:
((
"00"
+
o
[
k
]).
substr
((
""
+
o
[
k
]).
length
)));
}
}
return
fmt
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment