Eonasdan / tempus-dominus

A powerful Date/time picker widget.
https://getdatepicker.com
MIT License
7.15k stars 4.4k forks source link

Unable to parse date range from input value #2871

Closed hagen93 closed 10 months ago

hagen93 commented 11 months ago

Hi,

I was trying to initialize the picker from the input fields HTML value attribute, but I'm just ending up with erroneous single dates instead of ranges. Seems to me that the error might be in this line: https://github.com/Eonasdan/tempus-dominus/blob/4a348cb3f7c60cc2db6908c3154da7189e148e92/src/js/tempus-dominus.ts#L534 which probably should do the parsing for multiple in cases where dateRange is true too, e.g. condition might be this.optionsStore.options.multipleDates || this.optionsStore.options.dateRange.

I tried enabling multipleDates as a workaround, but that seems to be invalid configuration when dateRange is enabled.

hagen93 commented 11 months ago

For reference my configuration is as follows:

{
    dateRange: true,
    multipleDatesSeparator: ' - ',
    display: {
        components: {
            clock: false
        }
    },
    localization: {
        format: 'dd/MM/yyyy'
    }
}
Eonasdan commented 10 months ago

Hello. This was released with 6.7.19