Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
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
captainwong
douban-api-proxy
Commits
3258f4fb
Commit
3258f4fb
authored
Jul 18, 2017
by
Jonathan Rehm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make changes requested by Codacy
parent
61e0405f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
edit_books.js
cps/static/js/edit_books.js
+10
-9
No files found.
cps/static/js/edit_books.js
View file @
3258f4fb
/**
* Created by SpeedProg on 05.04.2015.
*/
/* global Bloodhound, language */
/* global Bloodhound, language
, Modernizr, tinymce
*/
tinymce
.
init
({
selector
:
'#description'
,
...
...
@@ -11,19 +11,20 @@ tinymce.init({
});
if
(
!
Modernizr
.
inputtypes
.
date
)
{
$
(
'#pubdate'
).
datepicker
({
format
:
'yyyy-mm-dd'
,
$
(
"#pubdate"
).
datepicker
({
format
:
"yyyy-mm-dd"
,
language
:
language
}).
on
(
'change'
,
function
()
{
}).
on
(
"change"
,
function
()
{
// Show localized date over top of the standard YYYY-MM-DD date
let
pubDate
,
results
;
if
((
results
=
/
(\d{4})[
-
\/\\](\d{1,2})[
-
\/\\](\d{1,2})
/
.
exec
(
this
.
value
)))
{
// YYYY-MM-DD
let
pubDate
;
const
results
=
/
(\d{4})[
-
\/\\](\d{1,2})[
-
\/\\](\d{1,2})
/
.
exec
(
this
.
value
);
// YYYY-MM-DD
if
(
results
)
{
pubDate
=
new
Date
(
results
[
1
],
parseInt
(
results
[
2
],
10
)
-
1
,
results
[
3
])
||
new
Date
(
this
.
value
);
}
$
(
'#fake_pubdate'
)
$
(
"#fake_pubdate"
)
.
val
(
pubDate
.
toLocaleDateString
(
language
))
.
removeClass
(
'hidden'
);
}).
trigger
(
'change'
);
.
removeClass
(
"hidden"
);
}).
trigger
(
"change"
);
}
/*
...
...
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