fix(schedule): Date rules silently ignored due to zero-padding mismatch in Day::Display#412
Open
vit0-9 wants to merge 1 commit intomeetsmore:masterfrom
Open
fix(schedule): Date rules silently ignored due to zero-padding mismatch in Day::Display#412vit0-9 wants to merge 1 commit intomeetsmore:masterfrom
vit0-9 wants to merge 1 commit intomeetsmore:masterfrom
Conversation
…ch in Day::Display
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug description**
Date-variant
ScheduleRules set via the API are silently ignored duringSchedule::freebusy, causing the schedule to fall back to the matchingWDayrule as if no date override existed.Root cause
Schedule::freebusybuilds adate_lookupHashMap using the raw string value stored inside theScheduleRuleVariant::Datevariant (e.g."2026-04-02"), then looks up each day usingday_cursor.to_string(). TheDay::Displayimplementation formats without zero-padding:Any client that sends ISO-8601 dates (which is the standard and what the TypeScript client does) will silently get no date override applied. This includes both blocking dates (
intervals: []) and date-specific custom hours.Fix
Two minimal changes:
Day::Display— zero-pad month and day to produce ISO-8601 compatible strings, making the format consistent everywhere:Schedule::freebusy— normalize date keys throughDay's parser before inserting intodate_lookup, so lookups are robust regardless of the input format:Fix 2 makes the lookup defensive against any future format variation. Fix 1 ensures the canonical output of
Dayis proper ISO-8601 from here on.