`Duration.toHuman` throws RangeError when Duration uses `quarters`
Author: ghostCreated Nov 27, 2023Updated Sep 4, 2026
Describe the bug
When using the toHuman() method on any Duration that has the quarters property set, the error RangeError: Invalid unit argument for Intl.NumberFormat() 'quarter' is thrown.
To Reproduce
var luxon = require("luxon")
const dur = luxon.Duration.fromObject({quarters: 1});
console.log(dur.toHuman())Link to RunKit: https://runkit.com/luca-audoora/luxon-quarters
Actual vs Expected behavior
I expected to get the string "1 quarter" back, above error is thrown instead.
Desktop (please complete the following information):
- OS: macOS 14.1.1 (23B81)
- Browser: Firefox 119.0.1 (64-Bit)
- Luxon version 3.4.3
- Your timezone "Europe/Berlin"
Source: moment/luxon