Description
Return the first working-day offset in a weekly mask.
Civil calendar arithmetic needs explicit year numbering, leap rules and index origins. A weekday mask or Gregorian component operation does not identify a timezone, working calendar or historical calendar reform.
Return the first working-day offset in a weekly mask.
When to use this tool
Use Date: Weekmask First Working Day Offset when checking the stated weekday or Gregorian calendar convention.
How to use the tool and how it works
- Enter startWeekday, workingMask. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Return the first working-day offset in a weekly mask. Require startWeekday in [0,6] and workingMask in [0,127]; search offsets zero through six using matching weekday bits, returning -1 and found = false if none.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| startWeekday | Weekday position on the caller-selected 0..6 convention; use the same convention throughout. | Required. Safe integer. |
| workingMask | Working Mask | Required. Safe integer. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Returned object; expand its named members below. | Required. Object. |
| result.found | Found | Calculated result member: boolean. |
| result.offsetDays | Offset Days | Calculated result member: number. |
{
"input": {
"startWeekday": 5,
"workingMask": 31
},
"output": {
"result": {
"found": true,
"offsetDays": 2
}
}
} Limitations and assumptions
- Bit numbering must match startWeekday; holidays and actual work calendars are not consulted.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use an appropriate full calendar library and authoritative local rules when business days, historical dates or real scheduling matter.
References
Similar or alternative tools
- ISO Weekday Cycle Offset
Advance an ISO weekday by a signed day offset with week carry.
- Weekday Periodic Step Reachability
Check reachability of one weekday under a repeating step.