Skip to content

feat: update version to 0.2.3 and implement seasonal table support#6

Merged
asvitloaten merged 11 commits into
masterfrom
125.12
Apr 27, 2026
Merged

feat: update version to 0.2.3 and implement seasonal table support#6
asvitloaten merged 11 commits into
masterfrom
125.12

Conversation

@asvitloaten

Copy link
Copy Markdown
Member

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 both getLightHour() and getLightTimeTable(). This introduces a 13LH season (6:00 PM is now 13LH instead of 1dh in Q2.2 and Q2.3), reduces dark hours to 11dh, and shifts midnight to 6dh in 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 a QuarterKey type. (src/types.ts Ffc8c5d5L1R1, [1] [2] [3] [4] [5]

Calendar Epoch Correction

  • Changed the Proper Day (Light Day) epoch to Dec 23, 2025 (was Dec 22, 2024), aligning with olsme.com. This affects getLightDay() and all related calculations. (src/core.ts [1] [2] [3] [4] [5]

API and Type Improvements

  • All date-sensitive APIs (getLightHour, getLightTimeTable) now accept an optional date argument, enabling historical and testable queries. (src/core.ts [1] [2] [3] [4] [5]
  • Added dayOfYear to LightDayInfo for easier year-based calculations. (src/core.ts [1] [2]

Documentation and Demo Updates

  • Updated README.md and added a CHANGELOG.md describing the new features, changes, and backward compatibility. (CHANGELOG.md [1] README.md [2] [3] [4] [5]
  • Added a new demo.html showing the seasonal table and widgets with the new logic. (demo.html demo.htmlR1-R167)

Test Coverage

  • Expanded and updated tests to cover seasonal transitions, new API functions, and the corrected epoch. (src/__tests__/core.test.ts F249d661L11R11, [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.

  • 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.

- 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.
@asvitloaten asvitloaten requested a review from Copilot April 26, 2026 14:40
@asvitloaten asvitloaten added documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers labels Apr 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 makes getLightHour() / getLightTimeTable() date-aware.
  • Corrects the default Proper Day epoch to 2025-12-23 and extends LightDayInfo with dayOfYear.
  • 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

  • dayOfYear is documented as 1–365, but the implementation returns (day - 1) % 365, which yields 0–364 and is also inconsistent with the dayInYear value used to compute quarter (which is 1–365). Adjust dayOfYear to 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.

Comment thread src/core.ts
Comment thread src/types.ts Outdated
Comment thread src/types.ts Outdated
Comment thread demo.html Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread src/types.ts Outdated
Comment thread demo.html Outdated
Comment thread demo.html Outdated
asvitloaten and others added 7 commits April 27, 2026 08:58
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread demo.html
Comment thread demo.html
Comment thread README.md
Comment thread src/core.ts
Comment thread src/__tests__/core.test.ts Outdated
Comment thread src/types.ts
Comment thread src/types.ts
…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>

Copilot AI commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

@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: d46612b7-47b9-44b6-8048-f1c22d68b80e

Sorry for the inconvenience!

@asvitloaten asvitloaten merged commit 7a5a2bd into master Apr 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants