changes for newest dp

This commit is contained in:
Christian Seyfferth 2019-01-15 11:35:56 +01:00
parent df89539710
commit 0cad7ccab4
4 changed files with 17 additions and 11 deletions

3
app.js
View File

@ -156,12 +156,11 @@ var app = new Vue({
day = moment(element.Datum); day = moment(element.Datum);
} }
if (element.hasOwnProperty('Dienst')) { if (element.hasOwnProperty('Dienst')) {
var time = moment(element.Zeit); var time = element.Zeit ? moment(element.Zeit) : day;
var date = day.hour(time.hour()).minute(time.minute()); var date = day.hour(time.hour()).minute(time.minute());
var bemerkung = !element.Bemerkung ? "" : element.Bemerkung.trim(); var bemerkung = !element.Bemerkung ? "" : element.Bemerkung.trim();
var art = !element.Dienst ? "" : element.Dienst.trim(); var art = !element.Dienst ? "" : element.Dienst.trim();
var name = !element.__EMPTY ? "" : element.__EMPTY.trim(); var name = !element.__EMPTY ? "" : element.__EMPTY.trim();
console.log({day, element});
vm.addShift(new Shift(art, name, date, bemerkung)); vm.addShift(new Shift(art, name, date, bemerkung));
} }
}); });

View File

@ -46,7 +46,7 @@
<th>Datum</th> <th>Datum</th>
<th>Wochentag</th> <th>Wochentag</th>
<th>Titel</th> <th>Titel</th>
<th>Uhrzeit</th> <th>Dauer</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
@ -61,11 +61,14 @@
<td class=""> <td class="">
{{s.VEventTitle}} {{s.VEventTitle}}
</td> </td>
<td class=""> <td class="" v-if="s.Beginn !== '00:00'">
{{s.Beginn}} - {{s.Ende}} {{s.Beginn}} - {{s.Ende}}
</td> </td>
<td class="" v-else>
ganzer Tag
</td>
<td class=""> <td class="">
<a class="btn-flat red-text wave" @click.stop="removeShift(s)"><i class="material-icons">delete</i></a> <a class="btn-flat red-text waves-effect" @click.stop="removeShift(s)"><i class="material-icons">delete</i></a>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -80,9 +83,9 @@
Noch keine Dienste da. Noch keine Dienste da.
</div> </div>
<div class="card-action" v-if="shifts.length < 1"> <div class="card-action" v-if="shifts.length < 1">
<label class="btn green tooltipped" data-position="left" data-tooltip="Dienstplan einlesen" for="fileInput"> <label class="btn green" data-position="left" data-tooltip="Dienstplan einlesen" for="fileInput">
<i class="material-icons">publish</i> <i class="material-icons">publish</i>
</label> </label>
</div> </div>
</div> </div>
<div class="fixed-action-btn"> <div class="fixed-action-btn">
@ -130,8 +133,6 @@
<span class="chip orange" :class="{'lighten-3' : r.title.length > 1, 'lighten-2' : r.title.length == 1}" v-for="t in r.title" :key="r.title.indexOf(t)">{{t}}</span> <span class="chip orange" :class="{'lighten-3' : r.title.length > 1, 'lighten-2' : r.title.length == 1}" v-for="t in r.title" :key="r.title.indexOf(t)">{{t}}</span>
</span> </span>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -178,6 +178,11 @@ Shift.prototype = {
} }
Shift.setDurationFromRules = function (shift) { Shift.setDurationFromRules = function (shift) {
'use strict'; 'use strict';
var isAllDayEvent = shift.Beginn == "00:00";
if (isAllDayEvent) {
shift.Dauer = moment.duration(24, 'h').locale(MOMENT_LOCALE);
return;
}
var art = shift.Art.toLowerCase(); var art = shift.Art.toLowerCase();
var name = shift.Name.toLowerCase(); var name = shift.Name.toLowerCase();
var duration = 60; var duration = 60;

View File

@ -1,6 +1,7 @@
var VCAL_DATETIME_FORMAT = "YMMDD[T]HHmmss"; //20160216T130500 var VCAL_DATETIME_FORMAT = "YMMDD[T]HHmmss"; //20160216T130500
var UID_FORMAT = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'; var UID_FORMAT = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
var NEW_LINE = "\r\n"; var NEW_LINE = "\r\n";
var productID = window.title;
function VMeta() { function VMeta() {
this.properties = new Map(); this.properties = new Map();
@ -63,7 +64,7 @@ function VCalendar(calendarName) {
this.tag = "VCALENDAR"; this.tag = "VCALENDAR";
this.set('X-WR-CALNAME', calendarName); this.set('X-WR-CALNAME', calendarName);
this.set('VERSION', '2.0'); this.set('VERSION', '2.0');
this.set('PRODID', window.location.href); this.set('PRODID', productID);
this.set('METHOD', "PUBLISH"); this.set('METHOD', "PUBLISH");
this.set('X-WR-TIMEZONE', "Europe/Berlin"); this.set('X-WR-TIMEZONE', "Europe/Berlin");
this.set('CALSCALE', "GREGORIAN"); this.set('CALSCALE', "GREGORIAN");