Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
d93fe113
Commit
d93fe113
authored
Jul 19, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复date format错误
parent
49ccba85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
jumpserver.js
apps/static/js/jumpserver.js
+12
-8
No files found.
apps/static/js/jumpserver.js
View file @
d93fe113
...
...
@@ -305,7 +305,6 @@ function requestApi(props) {
toastr
.
error
(
msg
);
}
if
(
typeof
props
.
error
===
'function'
)
{
console
.
log
(
jqXHR
);
return
props
.
error
(
jqXHR
.
responseText
,
jqXHR
.
status
);
}
});
...
...
@@ -610,7 +609,6 @@ jumpserver.initServerSideDataTable = function (options) {
if
(
kv
.
length
===
2
)
{
var
value
=
kv
[
1
];
value
=
value
.
replace
(
"+"
,
" "
);
console
.
log
(
value
);
search_attr
[
kv
[
0
]]
=
value
}
else
{
search_raw
.
push
(
kv
)
...
...
@@ -654,8 +652,6 @@ jumpserver.initServerSideDataTable = function (options) {
$
.
each
(
rows
,
function
(
id
,
row
)
{
table
.
selected_rows
.
push
(
row
);
if
(
row
.
id
&&
$
.
inArray
(
row
.
id
,
table
.
selected
)
===
-
1
){
console
.
log
(
table
)
console
.
log
(
table
.
selected
);
table
.
selected
.
push
(
row
.
id
)
}
})
...
...
@@ -1110,7 +1106,12 @@ function objectAttrsIsBool(obj, attrs) {
}
function
cleanDate
(
d
)
{
if
(
typeof
d
===
'number'
){
return
d
}
if
(
typeof
d
===
'number'
){
return
d
}
if
(
typeof
d
===
"string"
)
{
d
=
d
.
replaceAll
(
'-'
,
'/'
)
}
for
(
var
i
=
0
;
i
<
2
;
i
++
)
{
if
(
isNaN
(
Date
.
parse
(
d
)))
{
d
=
d
.
split
(
'+'
)[
0
].
trimRight
();
...
...
@@ -1121,9 +1122,13 @@ function cleanDate(d) {
return
''
}
function
safeDate
(
s
)
{
s
=
cleanDate
(
s
);
return
new
Date
(
s
)
}
function
formatDateAsCN
(
d
)
{
d
=
cleanDate
(
d
);
var
date
=
new
Date
(
d
);
var
date
=
safeDate
(
d
);
var
date_s
=
date
.
toLocaleString
(
navigator
.
language
,
{
hour12
:
false
});
return
date_s
.
split
(
"/"
).
join
(
'-'
)
}
...
...
@@ -1179,7 +1184,6 @@ function readFile(ref) {
var
hasFile
=
files
&&
files
.
length
>
0
;
if
(
hasFile
)
{
var
reader
=
new
FileReader
();
//新建一个FileReader
console
.
log
(
typeof
files
[
0
]);
reader
.
readAsText
(
files
[
0
],
"UTF-8"
);
//读取文件
reader
.
onload
=
function
(
evt
){
//读取完文件之后会回来这里
ref
.
trigger
(
"onload"
,
evt
.
target
.
result
);
...
...
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