Skip to content

Demos

English (US) is not included in Eufemia by default. You can include it like:

import enUS from '@dnb/eufemia/shared/locales/en-US'
<EufemiaProvider locale={enUS} ...>
App
</EufemiaProvider>

Range DatePicker

Default DatePicker

DatePicker:

<DatePicker
label="DatePicker:"
date="2019-05-05"
return_format="dd-MM-yyyy"
on_change={({ date }) => {
console.log('on_change', date)
}}
on_show={({ date }) => {
console.log('on_show', date)
}}
/>

Default DatePicker with Input

Hidden Nav:

Show month only

With info message

With suffix

Linked DatePickers

DatePicker:

<DatePicker label="DatePicker:" range link show_input />

DatePicker with error status

Please select a valid date
DatePicker:

<DatePicker
label="DatePicker:"
date="2019-05-05"
hide_navigation={true}
status="Please select a valid date"
/>

DatePicker with error

Status message with HTML inside
DatePicker:

<DatePicker
label="DatePicker:"
date="2019-05-05"
show_input={true}
show_submit_button={true}
stretch={true}
status={
<span>
Status message with <b>HTML</b> inside
</span>
}
/>

DatePicker with error status

DatePicker:

<DatePicker
label="DatePicker:"
date={new Date()}
hide_navigation={true}
status="error"
/>

Opened DatePicker

Also used for screenshot tests.

<DatePicker
opened={true}
prevent_close={true}
disable_autofocus={true}
range={true}
start_date="2019-05-05"
end_date="2019-06-05"
/>