assemblyscript-temporal
Advanced tools
Comparing version 1.10.0 to 1.10.1
@@ -40,2 +40,11 @@ import { PlainDate } from ".."; | ||
}); | ||
it("date.dayOfWeek further tests", () => { | ||
expect(new PlainDate(2021, 4, 19).dayOfWeek).toBe(1); | ||
expect(new PlainDate(2021, 4, 20).dayOfWeek).toBe(2); | ||
expect(new PlainDate(2021, 4, 21).dayOfWeek).toBe(3); | ||
expect(new PlainDate(2021, 4, 22).dayOfWeek).toBe(4); | ||
expect(new PlainDate(2021, 4, 23).dayOfWeek).toBe(5); | ||
expect(new PlainDate(2021, 4, 24).dayOfWeek).toBe(6); | ||
expect(new PlainDate(2021, 4, 25).dayOfWeek).toBe(7); | ||
}); | ||
}); | ||
@@ -42,0 +51,0 @@ |
@@ -1,3 +0,1 @@ | ||
/// <reference types="@as-pect/assembly/types/as-pect" /> | ||
import { Duration, DurationLike } from "../duration"; | ||
@@ -4,0 +2,0 @@ import { PlainDate } from "../plaindate"; |
@@ -1,3 +0,1 @@ | ||
/// <reference types="@as-pect/assembly/types/as-pect" /> | ||
import { Disambiguation } from "../enums"; | ||
@@ -4,0 +2,0 @@ import { Instant } from "../instant"; |
@@ -8,2 +8,4 @@ import { RegExp } from "assemblyscript-regex"; | ||
// @ts-ignore | ||
@lazy | ||
const NULL = i32.MAX_VALUE; | ||
@@ -10,0 +12,0 @@ |
import { zones, rules } from "./iana"; | ||
import { AtTimeZone } from "./rule"; | ||
// @ts-ignore | ||
@lazy | ||
let n: string; | ||
@@ -5,0 +7,0 @@ |
import { daysInMonth, dayOfWeek } from "../utils"; | ||
import { JsDate } from "../date"; | ||
@inline | ||
export enum AtTimeZone { | ||
@@ -5,0 +6,0 @@ // the 'at' time is measured in local time, i.e. incorporates daylight saving |
@@ -171,2 +171,3 @@ // for the proposal-temporal implementation, most of the business logic | ||
const w = (year + month + day) % 7; | ||
// Use ISO 8601 which has [1, 7] range to represent Monday-Sunday | ||
return w + (w <= 0 ? 7 : 0); | ||
@@ -490,3 +491,3 @@ } | ||
nanosecondsI64 = abs(nanosecondsI64); | ||
switch (largestUnit) { | ||
@@ -1109,3 +1110,3 @@ case TimeComponent.Years: | ||
const dateDuration2 = new Duration(y2, mon2, w2, d2, 0, 0, 0, 0, 0, 0); | ||
const intermediate = datePart.add(dateDuration1); | ||
@@ -1116,3 +1117,3 @@ const end = intermediate.add(dateDuration2); | ||
const dateDiff = datePart.until(end, dateLargestUnit); | ||
const dur = balanceDuration( | ||
@@ -1119,0 +1120,0 @@ dateDiff.days, |
{ | ||
"name": "assemblyscript-temporal", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "An implementation of temporal within AssemblyScript, with an initial focus on non-timezone-aware classes and functionality.", | ||
@@ -9,7 +9,10 @@ "main": "index.js", | ||
"scripts": { | ||
"test": "asp --verbose --nologo", | ||
"test:ci": "asp --summary", | ||
"pretest": "npm run asbuild:empty", | ||
"test": "asp --verbose --nologo && npm run test:empty", | ||
"test:empty": "diff build/empty.wat assembly/__tests__/empty.wat", | ||
"test:ci": "asp --summary && npm run test:empty", | ||
"asbuild:untouched": "asc assembly/index.ts --target debug", | ||
"asbuild:optimized": "asc assembly/index.ts --target release", | ||
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized" | ||
"asbuild": "npm run asbuild:untouched && npm run asbuild:optimized", | ||
"asbuild:empty": "asc --config asconfig.empty.json" | ||
}, | ||
@@ -25,4 +28,4 @@ "author": "colin.eberhardt@gmail.com", | ||
"dependencies": { | ||
"assemblyscript-regex": "^1.6.2" | ||
"assemblyscript-regex": "^1.6.3" | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
2593329
14
83
27348
Updatedassemblyscript-regex@^1.6.3