A small addon for interfacing with the Pikaday date-picker library.
import drill from 'react-drill'
drill(component)
.warpToPikaday()
.open()
.chooseDay(18)
.chooseMonth(7)
.chooseYear(1967)
.close()
The API can be found here but you need to provide your own
implementation of warpToPikaday
which has to do three things:
pikaday
A sample implementation for a DatePicker
component that has its pikaday set
on this._pika
would be:
import { PikadayScope } from 'react-drill/addons/pikaday'
import { registerExtension } from 'react-drill'
function warpToDatePicker() {
return (
this.find(DatePicker)
.ref('pikaday', x => x._pika)
.morph(PikadayScope)
)
}
// expose it on the default Scope:
registerExtension('warpToDatePicker', warpToDatePicker)