mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 12:45:50 +00:00
Much better date conversion.
Co-authored-by: Rome Reginelli <rome@ripple.com>
This commit is contained in:
@@ -188,10 +188,9 @@ Compute the Expiration Date, if present. The expiration date represents the numb
|
|||||||
var expirationDate = null
|
var expirationDate = null
|
||||||
if (standbyExpirationField.value !="") {
|
if (standbyExpirationField.value !="") {
|
||||||
var days = document.getElementById('standbyExpirationField').value
|
var days = document.getElementById('standbyExpirationField').value
|
||||||
var secondsInDay = 86400
|
let d = new Date()
|
||||||
var rippleEpoch = 946684800
|
d.setDate(d.getDate() + parseInt(days))
|
||||||
var currentTimestamp = (new Date() / 1000) - rippleEpoch
|
var expirationDate = xrpl.isoTimeToRippleTime(d)
|
||||||
expirationDate = parseInt(Math.floor(currentTimestamp + (days*secondsInDay)))
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user