mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #525 from gradido/fix-amount-input-field
fix: Validation of GDD Send Amount Field
This commit is contained in:
commit
53eac33a16
@ -54,10 +54,14 @@ extend('max', {
|
||||
extend('gddSendAmount', {
|
||||
validate(value, { min, max }) {
|
||||
value = value.replace(',', '.')
|
||||
return value.match(/^[0-9]+(\.[0-9]{1,2})?$/) && Number(value) >= min && Number(value) <= max
|
||||
return value.match(/^[0-9]+(\.[0-9]{0,2})?$/) && Number(value) >= min && Number(value) <= max
|
||||
},
|
||||
params: ['min', 'max'],
|
||||
message: (_, values) => i18n.t('form.validation.gddSendAmount', values),
|
||||
message: (_, values) => {
|
||||
values.min = i18n.n(values.min)
|
||||
values.max = i18n.n(values.max)
|
||||
return i18n.t('form.validation.gddSendAmount', values)
|
||||
},
|
||||
})
|
||||
|
||||
// eslint-disable-next-line camelcase
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user