mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove moment. localize date time
This commit is contained in:
parent
af2ea3e809
commit
5e78e4ad07
@ -20,16 +20,7 @@ const toastedSuccessMock = jest.fn()
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
$moment: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
subtract: jest.fn(() => {
|
||||
return {
|
||||
format: jest.fn((m) => m),
|
||||
}
|
||||
}),
|
||||
}
|
||||
}),
|
||||
$d: jest.fn((d) => d),
|
||||
$apollo: {
|
||||
mutate: apolloMutateMock,
|
||||
},
|
||||
|
||||
@ -154,22 +154,11 @@ export default {
|
||||
value: !this.creationUserData.amount ? 0 : this.creationUserData.amount,
|
||||
rangeMin: 0,
|
||||
rangeMax: 1000,
|
||||
currentMonth: {
|
||||
short: this.$moment().format('MMMM'),
|
||||
long: this.$moment().format('YYYY-MM-DD'),
|
||||
},
|
||||
lastMonth: {
|
||||
short: this.$moment().subtract(1, 'month').format('MMMM'),
|
||||
long: this.$moment().subtract(1, 'month').format('YYYY-MM') + '-01',
|
||||
},
|
||||
beforeLastMonth: {
|
||||
short: this.$moment().subtract(2, 'month').format('MMMM'),
|
||||
long: this.$moment().subtract(2, 'month').format('YYYY-MM') + '-01',
|
||||
},
|
||||
submitObj: null,
|
||||
isdisabled: true,
|
||||
createdIndex: null,
|
||||
selectedOpenCreationAmount: {},
|
||||
now: Date.now(),
|
||||
}
|
||||
},
|
||||
|
||||
@ -227,6 +216,30 @@ export default {
|
||||
})
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
currentMonth() {
|
||||
return {
|
||||
short: this.$d(this.now, 'month'),
|
||||
long: this.$d(this.now, 'short'),
|
||||
}
|
||||
},
|
||||
lastMonth() {
|
||||
const now = new Date(this.now)
|
||||
const lastMonth = new Date(now.getFullYear(), now.getMonth() - 1, 1)
|
||||
return {
|
||||
short: this.$d(lastMonth, 'month'),
|
||||
long: this.$d(lastMonth, 'short'),
|
||||
}
|
||||
},
|
||||
beforeLastMonth() {
|
||||
const now = new Date(this.now)
|
||||
const beforeLastMonth = new Date(now.getFullYear(), now.getMonth() - 2, 1)
|
||||
return {
|
||||
short: this.$d(beforeLastMonth, 'month'),
|
||||
long: this.$d(beforeLastMonth, 'short'),
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.creationUserData.date) {
|
||||
switch (this.$moment(this.creationUserData.date).format('MMMM')) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user