Baseweb: DatePicker component. How to start a week from Monday?

Created on 22 Jul 2020  路  4Comments  路  Source: uber/baseweb

Actually I already asked a question in the title :)
I didn't find how to do this so can you drop a hint please?

Thank you 馃檹馃徎

Most helpful comment

thank you @shdq 馃

All 4 comments

Hello Mikhail.

You should import locale from date-fns, I suppose it's ru and pass it to the datepicker as a prop. It will do the magic.

There is an example with customized mask, placeholder, and formatString.

import * as React from 'react';
import {Datepicker} from 'baseui/datepicker';
import ru from 'date-fns/locale/ru';

export default () => (
  <Datepicker
    locale={ru}
    onChange={({date}) => console.log(date)}
    mask="袛袛.袦袦.袚袚袚袚"
    placeholder="袛袛.袦袦.袚袚袚袚"
    formatString="dd.MM.yyyy"
  />
);

thank you @shdq 馃

for future reference, the corresponding doc site example can be found here: https://baseweb.design/components/datepicker/#datepicker-with-localization

@shdq @gergelyke thanks a lot guys!
I'm very appreciate your help 馃槍馃檹馃徎

Was this page helpful?
0 / 5 - 0 ratings