Reference · Flag source and framing metadata
flagOnfunction
The flag of a day with the reason for a blank: variantOn, and where it has nothing to draw (no flag known that day, or a restricted
one withheld), none says why in words and in a kind.
Import it
import { flagOn } from "@johnmorrisdotca/hata/manifest";
Definition
function flagOn(code: string, date: string | Date, options?: VariantOptions): FlagOnDay
Parameters
| Name | Type | Description |
|---|---|---|
code | string | A code in any case. |
date | string | Date | The day: a |
options (optional) | VariantOptions | undefined |
|
Returns
FlagOnDay
A FlagOnDay, always: variant is null and none is set where the package has no flag for it.
Examples
import { flagOn } from "@johnmorrisdotca/hata/manifest";
console.log(flagOn("DE", "1940").none?.reason); // "Flag of Nazi Germany, 1935–1945. Shown for history and education. …"
console.log(flagOn("SUHH", "1992-01-01").none?.kind); // "ended"
console.log(flagOn("CA", "1962-09-29", { role: "in-use" }).variant?.id); // "red-ensign-1957"Flag of Nazi Germany, 1935–1945. Shown for history and education. Displaying it is restricted by law in Germany and Austria outside those purposes.
ended
red-ensign-1957What it prints (run when this page was built)