mobx-binder-moment v1.4.0
= mobx-binder-moment
Converters and validators for https://momentjs.com/[Moment.js] to integrate with the DefaultBinder of link:../..mobx-binder.
== Conversion
The moment converter takes a https://momentjs.com/docs/#/parsing/string-format/[format string] and converts displayed strings to moment instances and vice versa.
If parsing fails, the validation fails with conversions.error.moment
message key.
== Validation
Validators for moment values have to be added to the binding chain after the converter.
.Example
source,js
import { MomentConverter, DayjsValidators } from 'mobx-binder-moment' ... binder.forField(fullName) .isRequired() .withConverter(new MomentConverter('DD.MM.YYYY')) .withValidator(DayjsValidators.dayInPast())
.bind()
Please check for supported validators and default error message keys link:src/validation/MomentValidators.tshere.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago