Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dic-global-dev
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Manzar Hussain
dic-global-dev
Commits
e37edfa5
Commit
e37edfa5
authored
Jan 27, 2021
by
Manzar Hussain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add time
parent
0ae0d84d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
override.js
themes/custom/envigo/js/override.js
+31
-2
No files found.
themes/custom/envigo/js/override.js
View file @
e37edfa5
...
...
@@ -259,7 +259,23 @@
var
regularMarketChangePercent
=
response
.
price
.
regularMarketChangePercent
.
fmt
;
$
(
'#bse_time_stock'
).
text
(
"IST "
+
regularMarketChange
+
" "
+
regularMarketChangePercent
)
let
unix_timestamp
=
response
.
price
.
regularMarketTime
;
// Create a new JavaScript Date object based on the timestamp
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
var
date
=
new
Date
(
unix_timestamp
*
1000
);
// Hours part from the timestamp
var
hours
=
date
.
getHours
();
// Minutes part from the timestamp
var
minutes
=
"0"
+
date
.
getMinutes
();
// Seconds part from the timestamp
var
seconds
=
"0"
+
date
.
getSeconds
();
// Will display time in 10:30:23 format
var
formattedTime
=
hours
+
':'
+
minutes
.
substr
(
-
2
)
+
':'
+
seconds
.
substr
(
-
2
);
$
(
'#bse_time_stock'
).
text
(
formattedTime
+
" IST "
+
regularMarketChange
+
" "
+
regularMarketChangePercent
)
if
(
regularMarketChangePercent
.
substring
(
0
,
1
)
==
'-'
)
{
...
...
@@ -287,7 +303,20 @@
$
(
'#nse'
).
text
(
"NSE:"
+
response
.
price
.
regularMarketPrice
.
fmt
);
var
regularMarketChange
=
response
.
price
.
regularMarketChange
.
fmt
;
var
regularMarketChangePercent
=
response
.
price
.
regularMarketChangePercent
.
fmt
;
$
(
'#nse_time_stock'
).
text
(
"IST "
+
regularMarketChange
+
" "
+
regularMarketChangePercent
)
let
unix_timestamp
=
response
.
price
.
regularMarketTime
;
// Create a new JavaScript Date object based on the timestamp
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
var
date
=
new
Date
(
unix_timestamp
*
1000
);
// Hours part from the timestamp
var
hours
=
date
.
getHours
();
// Minutes part from the timestamp
var
minutes
=
"0"
+
date
.
getMinutes
();
// Seconds part from the timestamp
var
seconds
=
"0"
+
date
.
getSeconds
();
// Will display time in 10:30:23 format
var
formattedTime
=
hours
+
':'
+
minutes
.
substr
(
-
2
)
+
':'
+
seconds
.
substr
(
-
2
);
$
(
'#nse_time_stock'
).
text
(
formattedTime
+
" IST "
+
regularMarketChange
+
" "
+
regularMarketChangePercent
)
if
(
regularMarketChangePercent
.
substring
(
0
,
1
)
==
'-'
)
{
$
(
'#nse'
).
parent
(
'li'
).
addClass
(
'down'
);
...
...
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