frappe / gantt

Open Source Javascript Gantt
https://frappe.io/gantt
MIT License
4.67k stars 1.04k forks source link

task._end.format('MMM D') does not work #107

Closed lambdaq closed 6 months ago

lambdaq commented 6 years ago

https://frappe.io/gantt

Custom HTML in popup

const end_date = task._end.format('MMM D');

task._end is a Date object, it does not have the format method

adedip commented 5 years ago

@lambdaq you can use task.end and format with new Date() ;)

dleunig commented 5 years ago

@lambdaq Changing the line to const end_date = moment(task._end).format('MMM D'); will fix the issue.

Make sure you imported momentjs.

safwansamsudeen commented 6 months ago

In fact, you could use date_utils inside the library... but yeah, moment makes more sense.