Merge pull request 'Fix floating point error for poll expiry' (#294) from xarvos/pleroma-fe:fix-poll-expire into develop

Reviewed-on: AkkomaGang/akkoma-fe#294
This commit is contained in:
floatingghost 2023-03-30 09:49:38 +00:00
commit 5911777aa2

View file

@ -103,9 +103,9 @@ export default {
convertExpiryFromUnit (unit, amount) { convertExpiryFromUnit (unit, amount) {
// Note: we want seconds and not milliseconds // Note: we want seconds and not milliseconds
switch (unit) { switch (unit) {
case 'minutes': return 0.001 * amount * DateUtils.MINUTE case 'minutes': return amount * DateUtils.MINUTE / 1000
case 'hours': return 0.001 * amount * DateUtils.HOUR case 'hours': return amount * DateUtils.HOUR / 1000
case 'days': return 0.001 * amount * DateUtils.DAY case 'days': return amount * DateUtils.DAY / 1000
} }
}, },
expiryAmountChange () { expiryAmountChange () {