Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fltrail
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fides
fltrail
Commits
77ce607e
Commit
77ce607e
authored
6 years ago
by
Sven Kästle
Browse files
Options
Downloads
Patches
Plain Diff
refactor: Change date format style on annotation card
parent
7eb81f59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gemeinsamforschen/src/main/webapp/assets/js/annotationScript.js
+12
-14
12 additions, 14 deletions
...samforschen/src/main/webapp/assets/js/annotationScript.js
with
12 additions
and
14 deletions
gemeinsamforschen/src/main/webapp/assets/js/annotationScript.js
+
12
−
14
View file @
77ce607e
...
...
@@ -511,29 +511,27 @@ function timestampToReadableTime(timestamp) {
// declare response
var
responseTimestamp
;
// get hours from date
var
hours
=
"
0
"
+
annotationDate
.
getHours
();
// get minutes from date
var
minutes
=
"
0
"
+
annotationDate
.
getMinutes
();
// if annotation is from today
if
(
isTimestampToday
(
timestamp
))
{
// get hours from date
var
hours
=
annotationDate
.
getHours
();
// get minutes from date
var
minutes
=
"
0
"
+
annotationDate
.
getMinutes
();
// get seconds from date
// var seconds = "0" + annotationDate.getSeconds();
// build readable timestamp
responseTimestamp
=
hours
+
"
:
"
+
minutes
.
substr
(
-
2
);
// build readable timestamp in format HH:mm
responseTimestamp
=
hours
.
substr
(
-
2
)
+
"
:
"
+
minutes
.
substr
(
-
2
);
}
// else annotation is not from today
else
{
// get date
var
date
=
annotationDate
.
getDate
();
var
date
=
"
0
"
+
annotationDate
.
getDate
();
// get month
var
month
=
annotationDate
.
getMonth
();
var
month
=
"
0
"
+
annotationDate
.
getMonth
();
// get year
var
year
=
annotationDate
.
getFullYear
();
var
year
=
""
+
annotationDate
.
getFullYear
();
// build readable timestamp
responseTimestamp
=
date
+
"
.
"
+
month
+
"
.
"
+
year
;
// build readable timestamp
dd.MM.yy HH:mm
responseTimestamp
=
date
.
substr
(
-
2
)
+
"
.
"
+
month
.
substr
(
-
2
)
+
"
.
"
+
year
.
substr
(
-
2
)
+
"
"
+
hours
.
substr
(
-
2
)
+
"
:
"
+
minutes
.
substr
(
-
2
)
;
}
return
responseTimestamp
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment