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 @@ ...@@ -39,7 +39,7 @@
localeKey: () => translationVm.activeLocale, localeKey: () => translationVm.activeLocale,
modules: function () { modules: function () {
// Logged out // Logged out
let modules = [] let modules = {}
// All icons used are taken from the Tango Project, which put them into public domain: // All icons used are taken from the Tango Project, which put them into public domain:
// http://tango.freedesktop.org // http://tango.freedesktop.org
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<script> <script>
export default { export default {
props: { props: {
modules: {type: Array, required: true}, modules: {type: Object, required: true},
user: {type: Object, required: true} user: {type: Object, required: true}
}, },
} }
......
...@@ -36,4 +36,48 @@ export default { ...@@ -36,4 +36,48 @@ export default {
'playlist': 'Playlist', 'playlist': 'Playlist',
'actions': 'Aktionen', '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 { ...@@ -36,5 +36,49 @@ export default {
'duration': 'Duration', 'duration': 'Duration',
'playlist': 'Playlist', 'playlist': 'Playlist',
'actions': 'Actions', '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 = [ var day = [
'Sunday', 'rrule.day.sunday',
'Monday', 'rrule.day.monday',
'Tuesday', 'rrule.day.tuesday',
'Wednesday', 'rrule.day.wednesday',
'Thursday', 'rrule.day.thursday',
'Friday', 'rrule.day.friday',
'Saturday' 'rrule.day.saturday'
] ]
var month = [ var month = [
'January', 'rrule.month.january',
'February', 'rrule.month.february',
'March', 'rrule.month.march',
'April', 'rrule.month.april',
'May', 'rrule.month.may',
'June', 'rrule.month.june',
'July', 'rrule.month.july',
'August', 'rrule.month.august',
'September', 'rrule.month.september',
'October', 'rrule.month.october',
'November', 'rrule.month.november',
'December' 'rrule.month.december'
] ]
export default { export default {
...@@ -44,9 +44,9 @@ export default { ...@@ -44,9 +44,9 @@ export default {
prettyDate: function (date) { prettyDate: function (date) {
var d = new Date(date) var d = new Date(date)
var dstring = '' var dstring = ''
dstring += day[d.getDay()] + ', ' dstring += this.$t(day[d.getDay()]) + ', '
dstring += this.leadingZero(d.getDate()) + '. ' dstring += this.leadingZero(d.getDate()) + '. '
dstring += month[d.getMonth()] + ' ' dstring += this.$t(month[d.getMonth()]) + ' '
dstring += d.getFullYear() dstring += d.getFullYear()
return dstring return dstring
}, },
...@@ -58,9 +58,9 @@ export default { ...@@ -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()) return this.leadingZero(d.getDate()) + '.' + this.leadingZero(d.getMonth() + 1) + '.' + d.getFullYear() + ' ' + this.leadingZero(d.getHours()) + ':' + this.leadingZero(d.getMinutes())
*/ */
var dstring = '' var dstring = ''
dstring += day[d.getDay()] + ', ' dstring += this.$t(day[d.getDay()]) + ', '
dstring += this.leadingZero(d.getDate()) + '. ' dstring += this.leadingZero(d.getDate()) + '. '
dstring += month[d.getMonth()] + ' ' dstring += this.$t(month[d.getMonth()]) + ' '
dstring += d.getFullYear() + ', ' dstring += d.getFullYear() + ', '
dstring += this.leadingZero(d.getHours()) + ':' + this.leadingZero(d.getMinutes()) + ':' + this.leadingZero(d.getSeconds()) dstring += this.leadingZero(d.getHours()) + ':' + this.leadingZero(d.getMinutes()) + ':' + this.leadingZero(d.getSeconds())
return dstring return dstring
...@@ -96,7 +96,12 @@ export default { ...@@ -96,7 +96,12 @@ export default {
return seconds * 1000 * 1000 * 1000; return seconds * 1000 * 1000 * 1000;
}, },
prettyWeekday: function(weekday) { prettyWeekday: function(weekday) {
return day[weekday]; let w;
if (weekday === 6) { w = 0 }
else { w = weekday + 1 }
return this.$t(day[w]);
} }
} }
} }
export default { 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: { methods: {
rruleRender (rrule) { rruleRender (rrule) {
let rule = this.rruleOptions.find(r => r.value === rrule) return this.$t(`rrule.rule.${rrule}`)
return rule.text
}, },
} }
} }
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