Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cellframe-ui-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
cellframe
cellframe-ui-sdk
Commits
71f0b6fa
Commit
71f0b6fa
authored
5 years ago
by
andrey.daragan
Browse files
Options
Downloads
Patches
Plain Diff
Develop
parent
9326dc39
No related branches found
No related tags found
1 merge request
!1
Support 3702
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libdap-qt-ui-chain-wallet.qrc
+1
-0
1 addition, 0 deletions
libdap-qt-ui-chain-wallet.qrc
resources/JS/TimeFunctions.js
+60
-0
60 additions, 0 deletions
resources/JS/TimeFunctions.js
with
61 additions
and
0 deletions
libdap-qt-ui-chain-wallet.qrc
+
1
−
0
View file @
71f0b6fa
...
...
@@ -14,5 +14,6 @@
<file>resources/fonts/roboto_regular.ttf</file>
<file>resources/fonts/roboto_thin_italic.ttf</file>
<file>resources/fonts/roboto_thin.ttf</file>
<file>resources/JS/TimeFunctions.js</file>
</qresource>
</RCC>
This diff is collapsed.
Click to expand it.
resources/JS/TimeFunctions.js
0 → 100644
+
60
−
0
View file @
71f0b6fa
//Splits a string from the log.
function
parceStringFromLog
(
string
)
{
var
split
=
string
.
split
(
/
\[
|
\]
\[
|
\]
|
\[
/
);
return
split
;
}
//This function converts the string representation of time to the Date format
function
parceTime
(
thisTime
)
{
var
aDate
=
thisTime
.
split
(
'
-
'
);
var
aDay
=
aDate
[
0
].
split
(
'
/
'
);
var
aTime
=
aDate
[
1
].
split
(
'
:
'
);
return
new
Date
(
20
+
aDay
[
2
],
aDay
[
0
]
-
1
,
aDay
[
1
],
aTime
[
0
],
aTime
[
1
],
aTime
[
2
]);
}
//Returns the time in the correct form
function
getTime
(
thisTime
)
{
var
tmpTime
=
new
Date
(
thisTime
)
var
thisHour
=
tmpTime
.
getHours
();
var
thisMinute
=
tmpTime
.
getMinutes
();
var
thisSecond
=
tmpTime
.
getSeconds
();
if
(
thisMinute
<
10
)
thisMinute
=
'
0
'
+
thisMinute
;
if
(
thisSecond
<
10
)
thisSecond
=
'
0
'
+
thisSecond
;
return
thisHour
+
'
:
'
+
thisMinute
+
'
:
'
+
thisSecond
;
}
//Returns the time in the correct form for the header
function
getDay
(
thisTime
,
privateDate
)
{
var
monthArray
=
[
"
January
"
,
"
February
"
,
"
March
"
,
"
April
"
,
"
May
"
,
"
June
"
,
"
July
"
,
"
August
"
,
"
September
"
,
"
October
"
,
"
November
"
,
"
December
"
];
var
tmpDate
=
new
Date
(
thisTime
);
var
thisMonth
=
tmpDate
.
getMonth
();
var
thisDay
=
tmpDate
.
getDate
();
var
thisYear
=
tmpDate
.
getFullYear
();
if
(
thisYear
===
privateDate
.
todayYear
)
{
if
(
thisMonth
===
privateDate
.
todayMonth
)
{
switch
(
thisDay
)
{
case
(
privateDate
.
todayDay
):
return
"
Today
"
;
case
(
privateDate
.
todayDay
-
1
):
return
"
Yesterday
"
;
default
:
return
monthArray
[
thisMonth
]
+
'
,
'
+
thisDay
;
}
}
else
return
monthArray
[
thisMonth
]
+
'
,
'
+
thisDay
;
}
else
return
monthArray
[
thisMonth
]
+
'
,
'
+
thisDay
+
'
,
'
+
thisYear
;
}
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