assemblyscript-temporal
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -9,1 +9,2 @@ import "./env"; | ||
export * from "./now"; | ||
export * from "./instant"; |
import { PlainDateTime } from "./plaindatetime"; | ||
import { PlainDate } from "./plaindate"; | ||
import { PlainTime } from "./plaintime"; | ||
import { Instant } from "./instant"; | ||
@@ -28,2 +30,18 @@ export class now { | ||
} | ||
static plainTimeISO(): PlainTime { | ||
const epochMillis = Date.now(); | ||
const date = new Date(epochMillis); | ||
return new PlainTime( | ||
date.getUTCHours(), | ||
date.getUTCMinutes(), | ||
date.getUTCSeconds(), | ||
date.getUTCMilliseconds() | ||
); | ||
} | ||
static instant(): Instant { | ||
const epochMillis = Date.now(); | ||
return Instant.fromEpochMilliseconds(epochMillis); | ||
} | ||
} |
@@ -340,1 +340,15 @@ ## Development and roadmap | ||
- [ ] rounding and smallest unit behaviour | ||
#### now | ||
Methods | ||
- [ ] zonedDateTimeISO | ||
- [ ] zonedDateTime | ||
- [x] instant | ||
- [ ] timeZone | ||
- [x] plainDateTimeISO | ||
- [ ] plainDateTime | ||
- [x] plainDateISO | ||
- [ ] plainDate | ||
- [x] plainTimeISO | ||
{ | ||
"name": "assemblyscript-temporal", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "An implementation of temporal within AssemblyScript, with an initial focus on non-timezone-aware classes and functionality.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
509790
12087