mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
change code, to review from moriz
This commit is contained in:
parent
8ad1e2920f
commit
dfc20a3254
@ -15,7 +15,7 @@
|
|||||||
<b-form ref="form" @submit.prevent="submit">
|
<b-form ref="form" @submit.prevent="submit">
|
||||||
<label>{{ $t('time.month') }}</label>
|
<label>{{ $t('time.month') }}</label>
|
||||||
<b-form-datepicker
|
<b-form-datepicker
|
||||||
id="testdate"
|
id="contribution-date"
|
||||||
v-model="date"
|
v-model="date"
|
||||||
size="lg"
|
size="lg"
|
||||||
:max="max"
|
:max="max"
|
||||||
@ -27,7 +27,7 @@
|
|||||||
></b-form-datepicker>
|
></b-form-datepicker>
|
||||||
<label class="mt-3">{{ $t('contribution.activity') }}</label>
|
<label class="mt-3">{{ $t('contribution.activity') }}</label>
|
||||||
<b-form-textarea
|
<b-form-textarea
|
||||||
id="testmemo"
|
id="contribution-memo"
|
||||||
v-model="memo"
|
v-model="memo"
|
||||||
rows="3"
|
rows="3"
|
||||||
max-rows="6"
|
max-rows="6"
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<label class="mt-3">{{ $t('form.amount') }}</label>
|
<label class="mt-3">{{ $t('form.amount') }}</label>
|
||||||
<b-input-group size="lg" prepend="GDD" append=".00">
|
<b-input-group size="lg" prepend="GDD" append=".00">
|
||||||
<b-form-input
|
<b-form-input
|
||||||
id="testamount"
|
id="contribution-amount"
|
||||||
v-model="amount"
|
v-model="amount"
|
||||||
type="number"
|
type="number"
|
||||||
min="1"
|
min="1"
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</b-input-group>
|
</b-input-group>
|
||||||
|
|
||||||
<div class="mt-3 text-right">
|
<div class="mt-3 text-right">
|
||||||
<b-button class="test-submit" type="submit" variant="primary" :disabled="disable">
|
<b-button class="test-submit" type="submit" variant="primary" :disabled="disabled">
|
||||||
{{ $t('contribution.submit') }}
|
{{ $t('contribution.submit') }}
|
||||||
</b-button>
|
</b-button>
|
||||||
{{date}}, {{amount}}, {{ memo}}
|
{{date}}, {{amount}}, {{ memo}}
|
||||||
@ -80,8 +80,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
minlength: 50,
|
minlength: 50,
|
||||||
maxlength: 255,
|
maxlength: 255,
|
||||||
lastMonth: new Date(new Date(new Date().setMonth(new Date().getMonth() - 1))),
|
|
||||||
min: new Date(new Date(new Date().setMonth(new Date().getMonth() - 1)).setDate(1)),
|
|
||||||
max: new Date(),
|
max: new Date(),
|
||||||
form: {
|
form: {
|
||||||
date: this.date,
|
date: this.date,
|
||||||
@ -98,10 +96,16 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
disable() {
|
lastMonth(){
|
||||||
|
return new Date(new Date(new Date().setMonth(new Date().getMonth() - 1)))
|
||||||
|
},
|
||||||
|
min() {
|
||||||
|
return new Date(new Date(new Date().setMonth(new Date().getMonth() - 1)).setDate(1))
|
||||||
|
},
|
||||||
|
disabled() {
|
||||||
if (
|
if (
|
||||||
this.form.memo.length < this.minlength ||
|
this.form.memo.length < this.minlength ||
|
||||||
this.form.amount === 0 ||
|
this.form.amount <= 0 ||
|
||||||
this.form.amount > 1000
|
this.form.amount > 1000
|
||||||
)
|
)
|
||||||
return true
|
return true
|
||||||
@ -110,16 +114,14 @@ export default {
|
|||||||
lastMonthObject() {
|
lastMonthObject() {
|
||||||
// new Date().getMonth === 1 If the current month is January, then one year must be gone back in the previous month
|
// new Date().getMonth === 1 If the current month is January, then one year must be gone back in the previous month
|
||||||
const obj = {
|
const obj = {
|
||||||
month: new Date(this.lastMonth).toLocaleString(this.$i18n.locale, { month: 'long' }),
|
monthAndYear: this.$d(new Date(this.lastMonth), 'monthAndYear'),
|
||||||
year: new Date().getMonth === 1 ? new Date().getFullYear() - 1 : new Date().getFullYear(),
|
|
||||||
creation: this.$store.state.creation[1],
|
creation: this.$store.state.creation[1],
|
||||||
}
|
}
|
||||||
return this.$t('contribution.formText.lastMonth', obj)
|
return this.$t('contribution.formText.lastMonth', obj)
|
||||||
},
|
},
|
||||||
thisMonthObject() {
|
thisMonthObject() {
|
||||||
const obj = {
|
const obj = {
|
||||||
month: new Date().toLocaleString(this.$i18n.locale, { month: 'long' }),
|
monthAndYear: this.$d(new Date(), 'monthAndYear'),
|
||||||
year: new Date().getFullYear(),
|
|
||||||
creation: this.$store.state.creation[2],
|
creation: this.$store.state.creation[2],
|
||||||
}
|
}
|
||||||
return this.$t('contribution.formText.thisMonth', obj)
|
return this.$t('contribution.formText.thisMonth', obj)
|
||||||
|
|||||||
@ -84,6 +84,10 @@ const dateTimeFormats = {
|
|||||||
year: {
|
year: {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
},
|
},
|
||||||
|
monthAndYear: {
|
||||||
|
month: 'long',
|
||||||
|
year: 'numeric',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
de: {
|
de: {
|
||||||
short: {
|
short: {
|
||||||
@ -108,6 +112,10 @@ const dateTimeFormats = {
|
|||||||
year: {
|
year: {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
},
|
},
|
||||||
|
monthAndYear: {
|
||||||
|
month: 'long',
|
||||||
|
year: 'numeric',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -35,10 +35,10 @@
|
|||||||
"activity": "Tätigkeit",
|
"activity": "Tätigkeit",
|
||||||
"formText": {
|
"formText": {
|
||||||
"h3": "Dein Beitrag zum Gemeinwohl",
|
"h3": "Dein Beitrag zum Gemeinwohl",
|
||||||
"lastMonth": "Für <b>{month} {year}</b> kannst du noch <b>{creation}</b> GDD einreichen.",
|
"lastMonth": "Für <b>{monthAndYear}</b> kannst du noch <b>{creation}</b> GDD einreichen.",
|
||||||
"text1": "Bring dich mit deinen Talenten in die Gemeinschaft ein! Dein freiwilliges Engagement honorieren wir mit 20 GDD pro Stunde bis maximal 1.000 GDD im Monat.",
|
"text1": "Bring dich mit deinen Talenten in die Gemeinschaft ein! Dein freiwilliges Engagement honorieren wir mit 20 GDD pro Stunde bis maximal 1.000 GDD im Monat.",
|
||||||
"text2": "Beschreibe deine Gemeinwohl-Tätigkeit mit Angabe der Stunden und trage einen Betrag von 20 GDD pro Stunde ein! Nach Bestätigung durch einen Moderator wird der Betrag deinem Konto gutgeschrieben.",
|
"text2": "Beschreibe deine Gemeinwohl-Tätigkeit mit Angabe der Stunden und trage einen Betrag von 20 GDD pro Stunde ein! Nach Bestätigung durch einen Moderator wird der Betrag deinem Konto gutgeschrieben.",
|
||||||
"thisMonth": "Für <b>{month} {year}</b> kannst du noch <b>{creation}</b> GDD einreichen. "
|
"thisMonth": "Für <b>{monthAndYear}</b> kannst du noch <b>{creation}</b> GDD einreichen. "
|
||||||
},
|
},
|
||||||
"noDateSelected": "Kein Datum ausgewählt",
|
"noDateSelected": "Kein Datum ausgewählt",
|
||||||
"submit": "Einreichen"
|
"submit": "Einreichen"
|
||||||
|
|||||||
@ -35,10 +35,10 @@
|
|||||||
"activity": "Activity",
|
"activity": "Activity",
|
||||||
"formText": {
|
"formText": {
|
||||||
"h3": "Your contribution to the common good",
|
"h3": "Your contribution to the common good",
|
||||||
"lastMonth": "For <b>{month} {year}</b>, you can still submit <b>{creation}</b> GDD.",
|
"lastMonth": "For <b>{monthAndYear}</b>, you can still submit <b>{creation}</b> GDD.",
|
||||||
"text1": "Bring your talents to the community! Your voluntary commitment will be rewarded with 20 GDD per hour up to a maximum of 1,000 GDD per month.",
|
"text1": "Bring your talents to the community! Your voluntary commitment will be rewarded with 20 GDD per hour up to a maximum of 1,000 GDD per month.",
|
||||||
"text2": "Describe your community service activity with hours and enter an amount of 20 GDD per hour! After confirmation by a moderator, the amount will be credited to your account.",
|
"text2": "Describe your community service activity with hours and enter an amount of 20 GDD per hour! After confirmation by a moderator, the amount will be credited to your account.",
|
||||||
"thisMonth": "For <b>{month} {year}</b>, you can still submit <b>{creation}</b> GDD."
|
"thisMonth": "For <b>{monthAndYear}</b>, you can still submit <b>{creation}</b> GDD."
|
||||||
},
|
},
|
||||||
"noDateSelected": "No date selected",
|
"noDateSelected": "No date selected",
|
||||||
"submit": "Submit"
|
"submit": "Submit"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user