Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

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

NameTypeDescription
codestring

A code in any case.

datestring | Date

The day: a Date, or "YYYY-MM-DD", "YYYY-MM" or "YYYY".

options (optional)VariantOptions | undefined

role and allowRestricted, as for variantOn.

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-1957

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.