startOfQuarterForUtc
Signature
Section titled “Signature”startOfQuarterForUtc(value: string): stringimport { startOfQuarterForUtc } from "@northguild/gmt/utc/calculate";Return the start of the quarter for a given UTC datetime string.
- Calculates quarter start month: Q1=1, Q2=4, Q3=7, Q4=10.
- Returns “” for invalid input.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO UTC datetime string (e.g. “2024-03-15T12:00:00Z”) |
Returns
Section titled “Returns”ISO UTC datetime string representing the start of the quarter, or “” on invalid input
Examples
Section titled “Examples”startOfQuarterForUtc("2024-03-15T12:00:00Z") // "2024-01-01T00:00:00Z"startOfQuarterForUtc("invalid") // ""