Skip to content

Getting "Invalid Date pass to format" on iOS Chrome but not on Web #100

@diegogallovich

Description

@diegogallovich

Hi @taylorhakes, I am hoping to reach you by opening this issue and also help anybody that might have encountered this problem before.

Issue while:
Generating a YYYY-MM-DD date using fecha.format(dateObj, 'YYYY-MM-DD')

Notes on the issue:
When formatting the date, for some reason on a desktop, the function works like a charm in any web browser I've tested (firefox, safari, chrome). However, on iOS, in Chrome and Safari, I keep receiving an "Invalid Date pass to format" error (See screenshot).

Code I am using:
data: { checkIn: fecha.format( new Date(datepicker.getValue().split(' - ')[0]), 'YYYY-MM-DD' ), checkOut: fecha.format( new Date(datepicker.getValue().split(' - ')[1]), 'YYYY-MM-DD' ) },

  • As you can see in the screenshot, two date strings are logged. These are the ones being passed to the function derived from the split.

image

I am looking forward to your response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions