A simple React datepicker component that exclusively uses UTC.
npm install --save react-utc-datepicker
- React >= 16
- MomentJS
- Font Awesome
import {ReactUTCDatepicker} from 'react-utc-datepicker';
format
prop, for formatting date (and time, if necessary); defaults to'YYYY-MM-DD'
. Uses Moment formatting.button
prop, for showing/hiding a button which opens the calendar popup (defaults totrue
)buttonPosition
prop, possible values arebefore
andafter
(defaults toafter
)onChange
prop, for tracking the date value
<ReactUTCDatepicker date={myDate} onChange={value => { console.log(value); }}/>
<ReactUTCDatepicker date={myDate} button={false} onChange={value => { console.log(value); }}></utc-datepicker/>
<ReactUTCDatepicker date={myDate} buttonPosition="before" format="MM/DD/YYYY HH:mm:ss" onChange={value => { console.log(value); }}/>