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

Function getFormattedDateString

packages/datetime/src/dateFormat.tsx:60–74  ·  view source on GitHub ↗
(
    date: Date | false | null,
    props: IDateFormatProps & IDatePickerBaseProps,
    ignoreRange = false,
)

Source from the content-addressed store, hash-verified

58}
59
60export function getFormattedDateString(
61 date: Date | false | null,
62 props: IDateFormatProps & IDatePickerBaseProps,
63 ignoreRange = false,
64) {
65 if (date == null) {
66 return "";
67 } else if (!isDateValid(date)) {
68 return props.invalidDateMessage;
69 } else if (ignoreRange || isDayInRange(date, [props.minDate, props.maxDate])) {
70 return props.formatDate(date, props.locale);
71 } else {
72 return props.outOfRangeMessage;
73 }
74}

Callers 4

renderMethod · 0.90
DateInputClass · 0.90
DateRangeInputClass · 0.90

Calls 3

isDateValidFunction · 0.90
isDayInRangeFunction · 0.90
formatDateMethod · 0.65

Tested by

no test coverage detected