File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -4,12 +4,22 @@ import { Scope } from "./scope.js";
44// Replace with Temporal.* types once they are provided by TypeScript
55// In addition to this minimal interface, these objects are also expected
66// to be supported by Intl.DateTimeFormat
7- interface TemporalObject {
8- epochMilliseconds ?: number ;
7+ interface TemporalInstant {
8+ epochMilliseconds : number
9+ toString ( ) : string ;
10+ }
11+ interface TemporalDateTypes {
12+ calendarId : string ;
913 toZonedDateTime ?( timeZone : string ) : { epochMilliseconds : number } ;
10- calendarId ?: string ;
1114 toString ( ) : string ;
1215}
16+ interface TemporalPlainTime {
17+ hour : number
18+ minute : number
19+ second : number
20+ toString ( ) : string ;
21+ }
22+ type TemporalObject = TemporalInstant | TemporalDateTypes | TemporalPlainTime
1323
1424export type FluentValue = FluentType < unknown > | string ;
1525
@@ -207,7 +217,7 @@ export class FluentDateTime extends FluentType<number | Date | TemporalObject> {
207217 if ( value instanceof Date ) return value . getTime ( ) ;
208218
209219 if ( "epochMilliseconds" in value ) {
210- return value . epochMilliseconds as number ;
220+ return value . epochMilliseconds ;
211221 }
212222
213223 if ( "toZonedDateTime" in value ) {
You can’t perform that action at this time.
0 commit comments