getDaysLeftInMonth
function getDaysLeftInMonth(date: Date, inclusive: boolean = false): number;
The date itself is not counted: on the last day of a month the answer is 0. It is the number of days still to come, which is what a quota or a billing period usually wants.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The date to read. It must be a valid |
|
| Whether the given day counts towards the total. |
Returns
number — the number of days left, 0 on the last day.
Throws
Exception | Condition |
|---|---|
| an argument is not a valid |
Examples
Counting
getDaysLeftInMonth(new Date(2026, 0, 20)); // => 11
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.