Simple input that converts user formatted dates into a date object and the other way around.
npm install --save nullstack-date-input
import Nullstack from 'nullstack';
import DateInput from 'nullstack-date-input';
class Application extends Nullstack {
deadline = new Date();
updateDeadline({value}) {
this.deadline = value;
}
render() {
return (
<DateInput name="deadline" value={this.deadline} onchange={this.updateDeadline} />
)
}
}
export default Application;
import Nullstack from 'nullstack';
import DateInput from 'nullstack-date-input';
class Application extends Nullstack {
deadline = new Date();
render() {
return (
<DateInput bind={this.deadline} />
)
}
}
export default Application;
The default hour is the start of the day
You can override it by passing true to the endOfDay or beginningOfDay attribute
<DateInput bind={this.startDate} beginningOfDay />
<DateInput bind={this.endDate} endOfDay />
You can customize the following attributes:
- id
- class
- placeholder
- disabled
- data-*
Currently this component only works with the DD/MM/YYYY format
Nullstack Date Input is released under the MIT License.