fullcalendar / fullcalendar

Full-sized drag & drop event calendar in JavaScript
https://fullcalendar.io
MIT License
18.65k stars 3.62k forks source link

when titleFormat is a string without a formatter plugin, should show console warning #4621

Open Xalior opened 5 years ago

Xalior commented 5 years ago

Issue: Any (except blank) custom formatter string in titleFormat on columns causes a JS crash

Docs Ref: https://fullcalendar.io/docs/view-specific-options

Description: Expected valid strings do not seem to work, even exact examples copied from documentation, e.g. 'YYYY/MM/DD'

ErrorLog:

  Uncaught TypeError: n.cmdFormatter is not a function
    at e.formatRange (VM168 main.min.js:7)
    at e.formatRange (VM168 main.min.js:8)
    at n.ei (VM168 main.min.js:7)
    at n.computeTitle (VM168 main.min.js:6)
    at n.render (VM168 main.min.js:8)
    at n.e.receiveProps (VM168 main.min.js:8)
    at e.renderComponent (VM168 main.min.js:9)
    at e.executeRender (VM168 main.min.js:9)
    at e.render (VM168 main.min.js:8)
    at HTMLDocument.<anonymous> (VM172 pen.js:69)

Codepen: Example at https://codepen.io/anon/pen/NmdWRo (inspect JS console to see crash)

See Also: This [https://github.com/CroudTech/vue-fullcalendar/issues/172](other, related, issue) on a custom Vue wrapper has been having this issue since 4.0.0alpha2, but did not have it in 4.0.0alpha1

acerix commented 5 years ago

As of v4, you need a plugin to use date formatting strings:

https://fullcalendar.io/docs/date-formatting#formatting-strings

For example with moment:

https://codepen.io/anon/pen/qwRvqa?editors=0010

The example on doc page should be updated to use a date formatting config object:

https://fullcalendar.io/docs/view-specific-options

arshaw commented 5 years ago

this has been fixed in the docs!

arshaw commented 5 years ago

but I will keep this issue open because we still need to implement a JS warning