Creating a duration using a decimal hour then using toFormat produces an incorrect result
The inputs we've seen wrong so far are 2.4 and 5.3
luxon.Duration.fromObject({hour: 2.4}).toFormat('hh:mm') returns "02:23"
luxon.Duration.fromObject({hour: 5.3}).toFormat('hh:mm') returns "05:17"
- 2.4 hours is 02:24
- 5.3 hours is 05:18
luxon.Duration.fromObject({minute: 2.4 * 60}).toFormat('hh:mm') = "02:24"
luxon.Duration.fromObject({second: 2.4 * 60 * 60}).toFormat('hh:mm') = "02:24"
luxon.Duration.fromObject({hour: 2.4}).shiftTo('seconds').toFormat('hh:mm') = "02:24"
luxon.Duration.fromObject({minute: 2.4 * 60}).shiftTo('hour').toFormat('hh:mm') = "02:23"
luxon.Duration.fromObject({hour: 2.4}).valueOf() = 8640000
luxon.Duration.fromObject({minute: 2.4 * 60}).valueOf() = 8640000
- Clone the library repository to your local development environment: https://github.com/moment/luxon
- Checkout to tag
2.1.1