MCPcopy
hub / github.com/palantir/blueprint / IDateFormatProps

Interface IDateFormatProps

packages/datetime/src/dateFormat.tsx:20–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18import { IDatePickerBaseProps } from "./datePickerCore";
19
20export interface IDateFormatProps {
21 /**
22 * The error message to display when the date selected is invalid.
23 * @default "Invalid date"
24 */
25 invalidDateMessage?: string;
26
27 /**
28 * The locale name, which is passed to `formatDate`, `parseDate`, and the functions in `localeUtils`.
29 */
30 locale?: string;
31
32 /**
33 * The error message to display when the date selected is out of range.
34 * @default "Out of range"
35 */
36 outOfRangeMessage?: string;
37
38 /**
39 * Placeholder text to display in empty input fields.
40 * Recommended practice is to indicate the expected date format.
41 */
42 placeholder?: string;
43
44 /**
45 * Function to render a JavaScript `Date` to a string.
46 * Optional `locale` argument comes directly from the prop on this component:
47 * if the prop is defined, then the argument will be too.
48 */
49 formatDate(date: Date, locale?: string): string;
50
51 /**
52 * Function to deserialize user input text to a JavaScript `Date` object.
53 * Return `false` if the string is an invalid date.
54 * Return `null` to represent the absence of a date.
55 * Optional `locale` argument comes directly from the prop on this component.
56 */
57 parseDate(str: string, locale?: string): Date | false | null;
58}
59
60export function getFormattedDateString(
61 date: Date | false | null,

Callers 5

assertDateEqualsFunction · 0.65
getFormattedDateStringFunction · 0.65
yvFunction · 0.65
eFunction · 0.65
eFunction · 0.65

Implementers 2

DateInputpackages/datetime/src/dateInput.tsx
DateRangeInputpackages/datetime/src/dateRangeInput.t

Calls

no outgoing calls

Tested by

no test coverage detected