Fix JSON Parse Error Invalid Date
This commit is contained in:
parent
0d64d9c72a
commit
ac4d6a712b
@ -53,13 +53,14 @@ export class TaskEditorComponent implements OnInit {
|
|||||||
createTask() {
|
createTask() {
|
||||||
let endDate_formatted: string|undefined = undefined;
|
let endDate_formatted: string|undefined = undefined;
|
||||||
let startDate_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');
|
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');
|
startDate_formatted = moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.taskService.tasksTaskgroupIDPut(this.editorData.taskgroupID, {
|
this.taskService.tasksTaskgroupIDPut(this.editorData.taskgroupID, {
|
||||||
taskName: this.nameCtrl.value,
|
taskName: this.nameCtrl.value,
|
||||||
eta: this.etaCtrl.value,
|
eta: this.etaCtrl.value,
|
||||||
@ -87,13 +88,14 @@ export class TaskEditorComponent implements OnInit {
|
|||||||
editTask() {
|
editTask() {
|
||||||
let endDate_formatted: string|undefined = undefined;
|
let endDate_formatted: string|undefined = undefined;
|
||||||
let startDate_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');
|
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');
|
startDate_formatted = moment(this.startDate.value).format('YYYY-MM-DDTHH:mm:ss.SSSZ');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.taskService.tasksTaskIDPost(this.editorData.task!.taskID, {
|
this.taskService.tasksTaskIDPost(this.editorData.task!.taskID, {
|
||||||
taskName: this.nameCtrl.value,
|
taskName: this.nameCtrl.value,
|
||||||
eta: this.etaCtrl.value,
|
eta: this.etaCtrl.value,
|
||||||
|
Loading…
Reference in New Issue
Block a user