diff --git a/Gruntfile.js b/Gruntfile.js index 166e196..80f3b0b 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -50,7 +50,7 @@ module.exports = grunt => { files: ["src/main/**/*.html"], tasks: ["copy:html"], }, - js: { + ts: { files: ["src/main/**/*.ts"], tasks: ["webpack:dev", "replace:dev"], }, diff --git a/package-lock.json b/package-lock.json index 04c3887..17f52cb 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index e8d8ce0..28392d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doomsday", - "version": "1.4.0", + "version": "1.4.1", "description": "Test your mastery of Conway's Doomsday rule.", "author": "Florine W. Dekker", "browser": "dist/bundle.js", @@ -19,7 +19,7 @@ "luxon": "^2.3.1" }, "devDependencies": { - "@types/luxon": "^2.3.0", + "@types/luxon": "^2.3.1", "grunt": "^1.4.1", "grunt-cli": "^1.4.3", "grunt-contrib-clean": "^2.0.0", @@ -29,7 +29,7 @@ "grunt-text-replace": "^0.4.0", "grunt-webpack": "^5.0.0", "ts-loader": "^9.2.8", - "typescript": "^4.6.2", + "typescript": "^4.6.3", "webpack": "^5.70.0", "webpack-cli": "^4.9.2" } diff --git a/src/main/js/Main.ts b/src/main/js/Main.ts index 0413f1d..dbad7a6 100644 --- a/src/main/js/Main.ts +++ b/src/main/js/Main.ts @@ -24,15 +24,15 @@ class ValidatableInput { /** * The input that is validatable. */ - readonly input: HTMLInputElement + readonly input: HTMLInputElement; /** * The label of which to update the text. */ - readonly titleLabel: HTMLElement + readonly titleLabel: HTMLElement; /** * The submission button that activates validation. */ - readonly button: HTMLButtonElement + readonly button: HTMLButtonElement; /** @@ -285,7 +285,8 @@ class DoomsdayDate { * @return the day of the week of the anchor of this `DoomsdayDate`'s century */ getCenturyAnchorString(): string { - return this.date.set({year: this.getCentury() * 100, month: 4, day: 4}).setLocale("en-US").weekdayLong; + // TODO: Support BCE years + return this.date.set({year: (this.getCentury() + 4) * 100, month: 4, day: 4}).setLocale("en-US").weekdayLong; }; /** @@ -294,7 +295,8 @@ class DoomsdayDate { * @return the day of the week of the anchor day of this `DoomsdayDate`'s year */ getYearAnchorString(): string { - return this.date.set({day: 4, month: 4}).setLocale("en-US").weekdayLong; + // TODO: Support BCE years + return this.date.set({year: this.date.year + 400, day: 4, month: 4}).setLocale("en-US").weekdayLong; }; /** @@ -303,7 +305,8 @@ class DoomsdayDate { * @return the day of the week of this `DoomsdayDate` */ getWeekdayString(): string { - return this.date.setLocale("en-US").weekdayLong; + // TODO: Support BCE years + return this.date.set({year: this.date.year + 400}).setLocale("en-US").weekdayLong; };