We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7bf7225 commit eeade77Copy full SHA for eeade77
src/relative-time-element.ts
@@ -170,7 +170,11 @@ export class RelativeTimeElement extends HTMLElement implements Intl.DateTimeFor
170
if (format === 'micro') {
171
duration = roundToSingleUnit(duration)
172
empty = microEmptyDuration
173
- if ((this.tense === 'past' && duration.sign !== -1) || (this.tense === 'future' && duration.sign !== 1)) {
+ // Allow month-level durations to pass through even with mismatched tense
174
+ if (
175
+ duration.months === 0 &&
176
+ ((this.tense === 'past' && duration.sign !== -1) || (this.tense === 'future' && duration.sign !== 1))
177
+ ) {
178
duration = microEmptyDuration
179
}
180
} else if ((tense === 'past' && duration.sign !== -1) || (tense === 'future' && duration.sign !== 1)) {
0 commit comments