mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 20:25:51 +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
|
||||
if (standbyExpirationField.value !="") {
|
||||
var days = document.getElementById('standbyExpirationField').value
|
||||
var secondsInDay = 86400
|
||||
var rippleEpoch = 946684800
|
||||
var currentTimestamp = (new Date() / 1000) - rippleEpoch
|
||||
expirationDate = parseInt(Math.floor(currentTimestamp + (days*secondsInDay)))
|
||||
let d = new Date()
|
||||
d.setDate(d.getDate() + parseInt(days))
|
||||
var expirationDate = xrpl.isoTimeToRippleTime(d)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user