Merge branch 'master' into 2121-Translate-locales-to-Spanish

This commit is contained in:
Alexander Friedland 2022-08-08 20:02:55 +02:00 committed by GitHub
commit 1b012365f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,13 +51,12 @@
</b-col>
</validation-provider>
<label class="mt-3">{{ $t('form.amount') }} {{ $t('math.asterisk') }}</label>
<b-input-group size="lg" prepend="GDD" append=".00">
<b-input-group size="lg" prepend="GDD">
<b-form-input
id="contribution-amount"
v-model="form.amount"
type="number"
min="1"
:max="isThisMonth ? maxGddThisMonth : maxGddLastMonth"
type="text"
:formatter="numberFormat"
></b-form-input>
</b-input-group>
<div
@ -104,7 +103,11 @@ export default {
}
},
methods: {
numberFormat(value) {
return value.replace(/\D/g, '')
},
submit() {
this.form.amount = this.numberFormat(this.form.amount)
if (this.form.id) {
this.$emit('update-contribution', this.form)
} else {
@ -132,8 +135,8 @@ export default {
if (
this.form.date === '' ||
this.form.memo.length < this.minlength ||
this.form.amount <= 0 ||
this.form.amount > 1000 ||
parseInt(this.form.amount) <= 0 ||
parseInt(this.form.amount) > 1000 ||
(this.isThisMonth && parseInt(this.form.amount) > parseInt(this.maxGddThisMonth)) ||
(!this.isThisMonth && parseInt(this.form.amount) > parseInt(this.maxGddLastMonth))
)