dayrule
v0.1.0NZ working-day math with the law section cited, holidays, and IRD, NZ bank and ABN checks.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
add_working_days
Add (or subtract) working days under a NZ statute's definition. Returns the date, the section cited and the holidays skipped. The start date is not counted.
| Parameter | Type | Description |
|---|---|---|
days * | integer | Number of working days to add; a negative number subtracts. |
rule * | string | Working-day rule name, e.g. 'holidays-act' (see list_rules). |
start_date * | string | Date to start from, YYYY-MM-DD. The start date is not counted. |
jurisdiction | string | Jurisdiction whose rules apply (default 'NZ'). |
region | Optional region, e.g. 'wellington'. |
count_working_days
Count working days after from_date up to and including to_date under a rule.
| Parameter | Type | Description |
|---|---|---|
from_date * | string | Start of the range; working days are counted after this date. |
rule * | string | Working-day rule name, e.g. 'holidays-act' (see list_rules). |
to_date * | string | End of the range, inclusive. |
jurisdiction | string | Jurisdiction whose rules apply (default 'NZ'). |
region | Optional region, e.g. 'wellington'. |
list_rules
List the working-day rules with their section reference, text and version.
| Parameter | Type | Description |
|---|---|---|
jurisdiction | string | Jurisdiction whose rules to list (default 'NZ'). |
nz_holidays
NZ public holidays (actual and observed dates) and provincial anniversary days for a year (2020-2030). Optional region, e.g. 'wellington'.
| Parameter | Type | Description |
|---|---|---|
year * | integer | Year to list holidays for (2020-2030). |
jurisdiction | string | Jurisdiction (default 'NZ'). |
region | Optional region for provincial anniversary days, e.g. 'wellington'. |
validate_ird
Free: check an NZ IRD number's check digit (Inland Revenue written steps; IRD's Example 3, 150000026, contradicts those steps and is reported invalid).
| Parameter | Type | Description |
|---|---|---|
number * | string | The NZ IRD number to check. |
jurisdiction | string | Jurisdiction (default 'NZ'). |
validate_nz_bank
Free: check an NZ bank account number (Inland Revenue algorithm). Checksum only; branch not verified against the Payments NZ register.
| Parameter | Type | Description |
|---|---|---|
account * | string | The NZ bank account number to check. |
jurisdiction | string | Jurisdiction (default 'NZ'). |
validate_abn
Free: check an Australian Business Number's checksum (ABR algorithm).
| Parameter | Type | Description |
|---|---|---|
abn * | string | The Australian Business Number to check. |
jurisdiction | string | Jurisdiction (default 'AU'). |