Skip to content

Run npx eslint . --ext .js,.ts --fix #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/duration-format-ponyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export default class DurationFormat {
unitStyle === '2-digit'
? twoDigitFormatOptions
: unitStyle === 'numeric'
? {}
: {style: 'unit', unit: nfUnit, unitDisplay: unitStyle}
? {}
: {style: 'unit', unit: nfUnit, unitDisplay: unitStyle}
list.push(new Intl.NumberFormat(locale, nfOpts).format(value))
}
return new ListFormat(locale, {
Expand Down
2 changes: 1 addition & 1 deletion src/duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import DurationFormat from './duration-format-ponyfill.js'
import type {DurationFormatOptions} from './duration-format-ponyfill.js'
const durationRe = /^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/
export const unitNames = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond'] as const
export type Unit = typeof unitNames[number]
export type Unit = (typeof unitNames)[number]

export const isDuration = (str: string) => durationRe.test(str)
type Sign = -1 | 0 | 1
Expand Down
9 changes: 7 additions & 2 deletions src/relative-time-element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Duration, elapsedTime, getRelativeTimeUnit, isDuration, roundToSingleUnit, Unit, unitNames} from './duration.js'
const HTMLElement = globalThis.HTMLElement || (null as unknown as typeof window['HTMLElement'])
const HTMLElement = globalThis.HTMLElement || (null as unknown as (typeof window)['HTMLElement'])

export type DeprecatedFormat = 'auto' | 'micro' | 'elapsed'
export type ResolvedFormat = 'duration' | 'relative' | 'datetime'
Expand All @@ -11,7 +11,12 @@ const emptyDuration = new Duration()
const microEmptyDuration = new Duration(0, 0, 0, 0, 0, 1)

export class RelativeTimeUpdatedEvent extends Event {
constructor(public oldText: string, public newText: string, public oldTitle: string, public newTitle: string) {
constructor(
public oldText: string,
public newText: string,
public oldTitle: string,
public newTitle: string,
) {
super('relative-time-updated', {bubbles: true, composed: true})
}
}
Expand Down