Fix JSON Parse Error Invalid Date #90

Merged
sebastian merged 1 commits from fix-issue-87 into master 2023-12-21 11:31:13 +01:00
Showing only changes of commit ac4d6a712b - Show all commits

View File

@ -53,13 +53,14 @@ export class TaskEditorComponent implements OnInit {
createTask() {
let endDate_formatted: string|undefined = undefined;
let startDate_formatted: string|undefined = undefined;
if(this.endDate.value !== "") {
if(this.endDate.value != undefined && this.endDate.value !== "") {
endDate_formatted = moment(this.endDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
}
if(this.startDate.value !== "") {
if(this.endDate.value != undefined && this.startDate.value !== "") {
startDate_formatted = moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
}
this.taskService.tasksTaskgroupIDPut(this.editorData.taskgroupID, {
taskName: this.nameCtrl.value,
eta: this.etaCtrl.value,
@ -87,13 +88,14 @@ export class TaskEditorComponent implements OnInit {
editTask() {
let endDate_formatted: string|undefined = undefined;
let startDate_formatted: string|undefined = undefined;
if(this.endDate.value !== "") {
if(this.endDate.value != undefined && this.endDate.value !== "") {
endDate_formatted = moment(this.endDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
}
if(this.startDate.value !== "") {
if(this.startDate.value != undefined && this.startDate.value !== "") {
startDate_formatted = moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
}
this.taskService.tasksTaskIDPost(this.editorData.task!.taskID, {
taskName: this.nameCtrl.value,
eta: this.etaCtrl.value,