Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Task CSS-7879 publish mobx binder #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/mobx-binder-core/src/model/fields/AbstractField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export abstract class AbstractField<ValueType> implements FieldStore<ValueType>
protected constructor(public readonly valueType: string, public readonly name: string) {
makeObservable(this, {
readOnly: observable,
required: observable,
changed: observable,
// required: observable,
// changed: observable,
showValidationResults: observable,
valid: observable,
validating: observable,
// valid: observable,
// validating: observable,
touched: observable,
visited: observable,
errorMessage: observable,
// errorMessage: observable,

updateValue: action,
handleFocus: action,
Expand Down Expand Up @@ -62,11 +62,11 @@ export abstract class AbstractField<ValueType> implements FieldStore<ValueType>

public reset(value: ValueType) {
this.value = value
this.changed = false
// this.changed = false
this.touched = false
this.visited = false
this.showValidationResults = false
this.valid = undefined
// this.valid = undefined
this.errorMessage = undefined
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ describe('DayjsConverter', () => {
it('should optionally except a locale', () => {
converter = new DayjsConverter('YYYY MMMM DD', 'es', true)
dayjs('2018 Enero 15', 'YYYY MMMM DD', 'es')

// TODO: DayJs is complaning that it's a invalid date
// see https://day.js.org/docs/en/i18n/instance-locale
expect(converter.convertToModel('2018 Enero 15')!.format('YYYY-MM-DD')).to.equal('2018-01-15')
})
})
Expand Down