1.4.0 • Published 1 year ago

mobx-binder-dayjs v1.4.0

Weekly downloads
17
License
MIT
Repository
github
Last release
1 year ago

= mobx-binder-dayjs

Converters and validators for https://day.js.org[Day.js] to integrate with the DefaultBinder of link:../..mobx-binder.

== Prerequisites

The module needs the https://day.js.org/docs/en/plugin/custom-parse-format[customParseFormat] dayjs plugin to be installed

source,js

import customParseFormat from 'dayjs/plugin/customParseFormat'

dayjs.extend(customParseFormat)

== Conversion

The Day.js converter takes a https://day.js.org/docs/en/parse/string-format[format string] and converts displayed strings to Dayjs instances and vice versa.

If parsing fails, the validation fails with conversions.error.dayjs message key.

== Validation

Validators for Dayjs values have to be added to the binding chain after the converter.

.Example

source,js

import { DayjsConverter, DayjsValidators } from 'mobx-binder-dayjs' ... binder.forField(fullName) .isRequired() .withConverter(new DayjsConverter('DD.MM.YYYY')) .withValidator(DayjsValidators.dayInPast())

.bind()

Please check for supported validators and default error message keys link:src/validation/DayjsValidators.tshere.

1.4.0-alpha.0

1 year ago

1.4.0-alpha.1

1 year ago

1.4.0-alpha.2

1 year ago

1.4.0

1 year ago

1.3.1

1 year ago

1.3.0

2 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago