feat: update version to 0.2.3 and implement seasonal table support#6
Conversation
- Added seasonal table support for light hours and light time table. - Introduced new public API: getActiveQuarter(date?) and getTimeData(date?). - Updated getLightHour(hourIndex?, date?) and getLightTimeTable(date?) to be date-aware. - Adjusted light hour values for Q2.2 and Q2.3, with midnight shifting to 6dh in Q2.3. - Corrected Proper Day epoch to Dec 23, 2025, affecting light day calculations. - Updated demo HTML to reflect changes and added styling for clarity. - Created CHANGELOG.md to document changes in version 0.2.3.
There was a problem hiding this comment.
Pull request overview
Adds season-aware Light Hour tables and related API updates to the OLS Light Calendar library, while correcting the Proper Day epoch and updating docs/tests for the new behavior.
Changes:
- Introduces quarter-based Light Time tables (Q2.2 / Q2.3) with selection via
getActiveQuarter()/getTimeData(), and makesgetLightHour()/getLightTimeTable()date-aware. - Corrects the default Proper Day epoch to
2025-12-23and extendsLightDayInfowithdayOfYear. - Updates public exports, documentation, demo page, tests, and bumps package version to
0.2.3.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/widgets/ols-calendar-widget.ts | Updates widget default epoch and option docs to align with the corrected epoch. |
| src/types.ts | Adds quarter-keyed season tables + selector APIs; updates config docs and data exports. |
| src/index.ts | Exposes the new seasonal APIs and tables via the public barrel. |
| src/core.ts | Switches core hour/table APIs to use season selection; adds dayOfYear to getLightDay(). |
| src/tests/core.test.ts | Expands coverage for seasonal selection and the corrected epoch. |
| package.json | Bumps library version to 0.2.3. |
| package-lock.json | Updates locked dependencies; currently has a root version mismatch vs package.json. |
| demo.html | Adds a local demo page for seasonal behavior; currently uses incorrect script filenames/version strings. |
| README.md | Documents new seasonal behavior and APIs; still contains some epoch default inconsistencies. |
| CHANGELOG.md | Adds a changelog entry for 0.2.3 describing the new features and epoch correction. |
Comments suppressed due to low confidence (1)
src/core.ts:97
dayOfYearis documented as 1–365, but the implementation returns(day - 1) % 365, which yields 0–364 and is also inconsistent with thedayInYearvalue used to computequarter(which is 1–365). AdjustdayOfYearto match the 1–365 convention (and keep it consistent with quarter calculation).
return {
day,
dayOfYear: (day - 1) % 365,
quarter,
quarterLabel: `Q${quarter}`,
year: lightYearBase + yearOffset,
};
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…epochDate default Agent-Logs-Url: https://github.com/onelightsystem/LT-LH/sessions/fd65e101-9ec4-44b0-86d1-9418e238a426 Co-authored-by: asvitloaten <33326470+asvitloaten@users.noreply.github.com>
…terministic Agent-Logs-Url: https://github.com/onelightsystem/LT-LH/sessions/65d2c204-c74f-4e4d-8527-1d5689592632 Co-authored-by: asvitloaten <33326470+asvitloaten@users.noreply.github.com>
|
@asvitloaten Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
Agent-Logs-Url: https://github.com/onelightsystem/LT-LH/sessions/083bd969-abe0-4f3e-90ea-675ed8c770a4 Co-authored-by: asvitloaten <33326470+asvitloaten@users.noreply.github.com>
This pull request introduces significant updates to the OLS Light Calendar library, primarily adding support for seasonal light hour tables that automatically adjust based on the current date. It also corrects the calendar epoch, expands the API, and updates documentation and tests to reflect these changes. All existing APIs remain backward compatible.
Key changes:
Seasonal Light Hour Table Support
Added automatic selection of the correct light hour table (
LIGHT_TIME_MAP_Q22,LIGHT_TIME_MAP_Q23) based on the current date, affecting bothgetLightHour()andgetLightTimeTable(). This introduces a 13LH season (6:00 PM is now13LHinstead of1dhin Q2.2 and Q2.3), reduces dark hours to 11dh, and shifts midnight to6dhin Q2.3. (src/types.ts[1] Ffc8c5d5L1R1, [2] [3] [4] F249d661L11R11, [5] [6] [7] [8] [9] [10] [11] [12] [13]Introduced new public API functions:
getActiveQuarter(date?),getTimeData(date?), and aQuarterKeytype. (src/types.tsFfc8c5d5L1R1, [1] [2] [3] [4] [5]Calendar Epoch Correction
olsme.com. This affectsgetLightDay()and all related calculations. (src/core.ts[1] [2] [3] [4] [5]API and Type Improvements
getLightHour,getLightTimeTable) now accept an optionaldateargument, enabling historical and testable queries. (src/core.ts[1] [2] [3] [4] [5]dayOfYeartoLightDayInfofor easier year-based calculations. (src/core.ts[1] [2]Documentation and Demo Updates
README.mdand added aCHANGELOG.mddescribing the new features, changes, and backward compatibility. (CHANGELOG.md[1]README.md[2] [3] [4] [5]demo.htmlshowing the seasonal table and widgets with the new logic. (demo.htmldemo.htmlR1-R167)Test Coverage
src/__tests__/core.test.tsF249d661L11R11, [1] [2] [3] [4]These changes ensure the library is season-aware, more accurate, and easier to use for both current and historical queries.- Added seasonal table support for light hours and light time table.