dev #3
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/orchester_dienstplan.iml" filepath="$PROJECT_DIR$/.idea/orchester_dienstplan.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/orchester_dienstplan.iml
generated
Normal file
8
.idea/orchester_dienstplan.iml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
68
app.js
68
app.js
@ -301,6 +301,37 @@ var app = new Vue({
|
||||
if (element.hasOwnProperty('Datum')) {
|
||||
day = moment(element.Datum);
|
||||
}
|
||||
|
||||
if (element.hasOwnProperty('Bemerkung')) {
|
||||
if (element.Bemerkung.toString().search(/\d\d:\d\d\s/) >= 0) {
|
||||
// prüfe ob eine Uhrzeit drinnen steht
|
||||
let sonderzeit = moment(element.Bemerkung, 'HH:mm');
|
||||
let name = element.Bemerkung.toString().replace(/\d\d:\d\d\s/, '').trim();
|
||||
let splittedName = name.split(' ');
|
||||
|
||||
let terminArt = '';
|
||||
splittedName.forEach(function (item) {
|
||||
vm.rules.forEach(function (rule) {
|
||||
rule.Arten.forEach(function (art) {
|
||||
if (art.tag == item) {
|
||||
terminArt = art.tag;
|
||||
name.replace(art.tag, '');
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
let termin = {
|
||||
datum : day.clone().hour(sonderzeit.hour()).minute(sonderzeit.minute()),
|
||||
art : terminArt,
|
||||
beschreibung: '',
|
||||
name : name.trim()
|
||||
}
|
||||
vm.addShift(new Shift(termin));
|
||||
beschreibung = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (element.hasOwnProperty('Dienst')) {
|
||||
|
||||
let times = [];
|
||||
@ -312,6 +343,13 @@ var app = new Vue({
|
||||
let mom = moment(time, 'HH:mm');
|
||||
times.push([mom.hour(), mom.minute()]);
|
||||
})
|
||||
} else if (element.Zeit.toString().indexOf(' - ') > 0) {
|
||||
// in der Zeitspalte stehen mehrere Uhrzeiten als Zeitspanne
|
||||
let tempTimes = element.Zeit.toString().split(' - ');
|
||||
|
||||
let mom = moment(tempTimes[0], 'HH:mm');
|
||||
let momEnd = moment(tempTimes[1], 'HH:mm');
|
||||
times.push([mom.hour(), mom.minute(), momEnd.hour(), momEnd.minute()]);
|
||||
} else {
|
||||
if (element.Zeit) {
|
||||
let mom = moment(element.Zeit);
|
||||
@ -320,29 +358,18 @@ var app = new Vue({
|
||||
times.push([0, 0]);
|
||||
}
|
||||
}
|
||||
if (element.hasOwnProperty('Bemerkung')) {
|
||||
if (element.Bemerkung.toString().search(/\d\d:\d\d\s/) >= 0) {
|
||||
// prüfe ob eine Uhrzeit drinnen steht
|
||||
let sonderzeit = moment(element.Bemerkung, 'HH:mm');
|
||||
let termin = {
|
||||
datum: day.clone().hour(sonderzeit.hour()).minute(sonderzeit.minute()),
|
||||
art: '',
|
||||
beschreibung: '',
|
||||
name: element.Bemerkung.toString().replace(/\d\d:\d\d\s/, '').trim()
|
||||
}
|
||||
vm.addShift(new Shift(termin));
|
||||
beschreibung = '';
|
||||
} else {
|
||||
beschreibung = element.Bemerkung;
|
||||
}
|
||||
}
|
||||
if (element.hasOwnProperty('Dienst')) {
|
||||
|
||||
art = element.Dienst.trim();
|
||||
}
|
||||
|
||||
if (element.hasOwnProperty('__EMPTY')) {
|
||||
name = element.__EMPTY.trim();
|
||||
}
|
||||
|
||||
if (element.hasOwnProperty('Bemerkung')
|
||||
&& element.Bemerkung.toString().search(/\d\d:\d\d\s/) == -1) {
|
||||
beschreibung = element.Bemerkung;
|
||||
}
|
||||
|
||||
times.forEach(time => {
|
||||
var termin = {
|
||||
datum : day.clone().hour(time[0]).minute(time[1]),
|
||||
@ -350,6 +377,11 @@ var app = new Vue({
|
||||
beschreibung: beschreibung,
|
||||
name : name
|
||||
}
|
||||
if (time.length === 4) {
|
||||
// Wenn die Zeit mehr Werte hat, dann behandle die nächsten 2 als ende
|
||||
termin.end = day.clone().hour(time[2]).minute(time[3]);
|
||||
termin.dontSetDurationFromRules = true;
|
||||
}
|
||||
vm.addShift(new Shift(termin));
|
||||
});
|
||||
|
||||
|
||||
@ -156,6 +156,7 @@ function Shift() {
|
||||
'art' : "",
|
||||
'name' : "DUMMY",
|
||||
'datum' : moment(),
|
||||
'end' : moment(),
|
||||
'beschreibung': "",
|
||||
'ort' : "",
|
||||
}
|
||||
@ -165,6 +166,7 @@ function Shift() {
|
||||
|
||||
this.Datum = options.datum.format(DATE_INPUT_FORMAT);
|
||||
this.Beginn = options.datum.format(TIME_FORMAT);
|
||||
this.Ende = options.end.format(TIME_FORMAT);
|
||||
this.Art = options.art;
|
||||
this.Beschreibung = options.beschreibung;
|
||||
this.Name = options.name;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user