Skip to content

Commit

Permalink
fix: do not use buggy toJSDate
Browse files Browse the repository at this point in the history
Signed-off-by: Raimund Schlüßler <[email protected]>
  • Loading branch information
raimund-schluessler committed Aug 5, 2024
1 parent 069a909 commit e202f16
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/models/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,9 @@ export default class Task {
this._summary = this.vtodo.getFirstPropertyValue('summary') || ''
this._priority = this.vtodo.getFirstPropertyValue('priority') || 0
this._complete = this.vtodo.getFirstPropertyValue('percent-complete') || 0
const comp = this.vtodo.getFirstPropertyValue('completed')
this._completed = !!comp
this._completedDate = comp ? comp.toJSDate() : null
this._completedDate = this.vtodo.getFirstPropertyValue('completed')
this._completedDateMoment = moment(this._completedDate, 'YYYYMMDDTHHmmssZ')
this._completed = !!this._completedDate
this._status = this.vtodo.getFirstPropertyValue('status')
this._note = this.vtodo.getFirstPropertyValue('description') || ''
this._related = this.getParent()?.getFirstValue() || null
Expand Down Expand Up @@ -316,7 +315,7 @@ export default class Task {
}
this.updateLastModified()
this._completed = completed
this._completedDate = completed ? now.toJSDate() : null
this._completedDate = now
this._completedDateMoment = moment(this._completedDate, 'YYYYMMDDTHHmmssZ')
}

Expand Down

0 comments on commit e202f16

Please sign in to comment.