Material-ui-pickers: without default value date picker (feature Request)

Created on 22 Jan 2018  路  6Comments  路  Source: mui-org/material-ui-pickers

Dear

Is that possible run DatePicker with value={null} because i don't wanna select date by default

BR,

question

Most helpful comment

@cherniavskii ok what do you want ?

i'm using date picker and i need empty date picker when component did mount

actually by default selected today

All 6 comments

@soroushm yes, it's possible.

@cherniavskii ok how working ?

with value={null} i will get a error

bundle.js:156606 Uncaught Error: Invalid Jalaali year -100721
    at jalCal (bundle.js:156606)
    at d2j (bundle.js:156670)
    at Object.toJalaali (bundle.js:156538)
    at toJalaali (bundle.js:140024)
    at F.jMoment.fn.jYear (bundle.js:139763)
    at F.jYYYY (bundle.js:139230)
    at Object.jYYYY/jMM/jDD (bundle.js:139415)
    at F.jMoment.fn.format (bundle.js:139746)
    at labelFunc (bundle.js:135337)
    at DateTextField._this.getDisplayDate (bundle.js:157032)

<DatePicker okLabel={t('Ok')} cancelLabel={t('Cancel')} labelFunc={date => (jMoment(date).format('jYYYY/jMM/jDD'))} value={null} leftArrowIcon={<KeyboardArrowLeft />} rightArrowIcon={<KeyboardArrowRight />} disablePast fullWidth autoOk animateYearScrolling onChange={this.handleDateChange} shouldDisableDate={this.shouldDisableDate} utils={jalaliUtils} />

Version
[email protected]
material-ui-pickers-jalali-utils@^0.2.0

and without value attr by default selected today

@dmtrKovalenko any Update ?

@soroushm if you are experiencing a bug - please submit an issue with detailed description. It's hard to help you without details.

@cherniavskii ok what do you want ?

i'm using date picker and i need empty date picker when component did mount

actually by default selected today

Ideally - live example reproducing the issue (e.g. on Codesandbox)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

charlax picture charlax  路  3Comments

danmce picture danmce  路  3Comments

nicky-dev picture nicky-dev  路  3Comments

harvitronix picture harvitronix  路  3Comments

benneq picture benneq  路  3Comments