Commit 5ed0887b authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Fix issue with schedule having different weekday than emission

parent 8970142c
......@@ -39,7 +39,7 @@
localeKey: () => translationVm.activeLocale,
modules: function () {
// Logged out
let modules = []
let modules = {}
// All icons used are taken from the Tango Project, which put them into public domain:
// http://tango.freedesktop.org
......
......@@ -97,7 +97,7 @@
<script>
export default {
props: {
modules: {type: Array, required: true},
modules: {type: Object, required: true},
user: {type: Object, required: true}
},
}
......
......@@ -36,4 +36,48 @@ export default {
'playlist': 'Playlist',
'actions': 'Aktionen',
},
// Etc
'rrule': {
'day': {
'sunday': 'Sonntag',
'monday': 'Montag',
'tuesday': 'Dienstag',
'wednesday': 'Mittwoch',
'thursday': 'Donnerstag',
'friday': 'Freitag',
'saturday': 'Samstag',
},
'month': {
'january': 'Januar',
'february': 'Februar',
'march': 'März',
'april': 'April',
'may': 'Mai',
'june': 'Juni',
'july': 'Juli',
'august': 'August',
'september': 'September',
'october': 'Oktober',
'november': 'November',
'december': 'Dezember',
},
'rule': {
'1': 'einmalig',
'2': 'täglich',
'3': 'werktäglich',
'4': 'wöchentlich',
'5': 'zweiwöchentlich',
'6': 'vierwöchentlich',
'7': 'gerade Kalenderwoche',
'8': 'ungerade Kalenderwoche',
'9': 'Jede 1. Woche im Monat',
'10': 'Jede 2. Woche im Monat',
'11': 'Jede 3. Woche im Monat',
'12': 'Jede 4. Woche im Monat',
'13': 'Jede 5. Woche im Monat',
}
},
}
......@@ -36,5 +36,49 @@ export default {
'duration': 'Duration',
'playlist': 'Playlist',
'actions': 'Actions',
}
},
// Etc
'rrule': {
'day': {
'sunday': 'Sunday',
'monday': 'Monday',
'tuesday': 'Tuesday',
'wednesday': 'Wednesday',
'thursday': 'Thursday',
'friday': 'Friday',
'saturday': 'Saturday',
},
'month': {
'january': 'January',
'february': 'February',
'march': 'March',
'april': 'April',
'may': 'May',
'june': 'June',
'july': 'July',
'august': 'August',
'september': 'September',
'october': 'October',
'november': 'November',
'december': 'December',
},
'rule': {
'1': 'once',
'2': 'daily',
'3': 'workdays',
'4': 'weekly',
'5': 'every two weeks',
'6': 'every four weeks',
'7': 'even calendar weeks',
'8': 'uneven calendar weeks',
'9': 'Every first week of the month',
'10': 'Every second week of the month',
'11': 'Every third week of the month',
'12': 'Every fourth week of the month',
'13': 'Every fifth week of the month',
}
},
}
var day = [
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday'
'rrule.day.sunday',
'rrule.day.monday',
'rrule.day.tuesday',
'rrule.day.wednesday',
'rrule.day.thursday',
'rrule.day.friday',
'rrule.day.saturday'
]
var month = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
'rrule.month.january',
'rrule.month.february',
'rrule.month.march',
'rrule.month.april',
'rrule.month.may',
'rrule.month.june',
'rrule.month.july',
'rrule.month.august',
'rrule.month.september',
'rrule.month.october',
'rrule.month.november',
'rrule.month.december'
]
export default {
......@@ -44,9 +44,9 @@ export default {
prettyDate: function (date) {
var d = new Date(date)
var dstring = ''
dstring += day[d.getDay()] + ', '
dstring += this.$t(day[d.getDay()]) + ', '
dstring += this.leadingZero(d.getDate()) + '. '
dstring += month[d.getMonth()] + ' '
dstring += this.$t(month[d.getMonth()]) + ' '
dstring += d.getFullYear()
return dstring
},
......@@ -58,9 +58,9 @@ export default {
return this.leadingZero(d.getDate()) + '.' + this.leadingZero(d.getMonth() + 1) + '.' + d.getFullYear() + ' ' + this.leadingZero(d.getHours()) + ':' + this.leadingZero(d.getMinutes())
*/
var dstring = ''
dstring += day[d.getDay()] + ', '
dstring += this.$t(day[d.getDay()]) + ', '
dstring += this.leadingZero(d.getDate()) + '. '
dstring += month[d.getMonth()] + ' '
dstring += this.$t(month[d.getMonth()]) + ' '
dstring += d.getFullYear() + ', '
dstring += this.leadingZero(d.getHours()) + ':' + this.leadingZero(d.getMinutes()) + ':' + this.leadingZero(d.getSeconds())
return dstring
......@@ -96,7 +96,12 @@ export default {
return seconds * 1000 * 1000 * 1000;
},
prettyWeekday: function(weekday) {
return day[weekday];
let w;
if (weekday === 6) { w = 0 }
else { w = weekday + 1 }
return this.$t(day[w]);
}
}
}
export default {
computed: {
rruleOptions () {
return [
{ value: 1, text: 'einmalig' },
{ value: 2, text: 'täglich' },
{ value: 3, text: 'werktäglich' },
{ value: 4, text: 'wöchentlich' },
{ value: 5, text: 'zweiwöchentlich' },
{ value: 6, text: 'vierwöchentlich' },
{ value: 7, text: 'gerade Kalenderwoche' },
{ value: 8, text: 'ungerade Kalenderwoche' },
{ value: 9, text: 'Jede 1. Woche im Monat' },
{ value: 10, text: 'Jede 2. Woche im Monat' },
{ value: 11, text: 'Jede 3. Woche im Monat' },
{ value: 12, text: 'Jede 4. Woche im Monat' },
{ value: 13, text: 'Jede 5. Woche im Monat' },
]
},
},
methods: {
rruleRender (rrule) {
let rule = this.rruleOptions.find(r => r.value === rrule)
return rule.text
return this.$t(`rrule.rule.${rrule}`)
},
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment