spotty-amberS
Refine4y ago
1 reply
spotty-amber

Uncaught TypeError date.locale is not a function

I am using ant design TimePicker component on my form. While creating a form it doesn't have a problem but when I am trying to edit and click on edit icon then my edit page crashes with the above mentioned error. My detail page response from API is:

{
  "details": {
    "id": 45,
    "created_by": 3,
    "route": 7,
    "via": [],
    "shift": "N",
    "start_time": "05:00:00",
    "end_time": "08:00:00",
    "price": 232,
    "has_dynamic_price": false,
    "is_cancelled": false,
    "pickup_points": [
      {
        "id": 45,
        "point": 14,
        "time": "5:00 AM"
      },
      {
        "id": 46,
    "point": 3,
    "time": "6:00 AM"
      }
    ],
    "drop_points": [
      {
    "id": 28,
    "point": 11,
    "price": null,
    "time": "8:00 AM"
      }
    ]
  }
}

And I get the start_time and end_time as string, which TimePicker component cannot convert to dayjs. What can I do to make it work?
Was this page helpful?