Search code examples
jqwidget

jqwidgets-datetimeinput date format d MMMM yyyy not displayed correctly


I am using jqwidgets-datetimeinput to display and input formatted date. It is working fine for most of the use cases but for the format d MMMM yyyy it is not behaving correctly.

it is showing as 6/11/2020 June 2020 instead of 11 June 2020


Solution

  • Interesting. I think you just found one of the many bugs/"features" that plague jqWidgets.

    Upon further investigation, this seems to happen when d is the end of the format string, or is followed by a space character. To get around this, you can use a non-breaking space:

    'd\u00a0MMMM yyyy'

    If you're on Windows, you can also do Alt+0160 to type it out, but this may be unwise, as the two characters look identical.