Eonasdan / tempus-dominus

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

Issues with validation using dateRange #2915

Open itajackass opened 3 months ago

itajackass commented 3 months ago

Prerequisites

Describe the issue

Hi, i think there is a bug using: dateRange: true.

When activated, I expected that the input field is valid only if I select a START and END dates. But it seems the plugin allow to select also only 1 date without errors... I expected that if I choose only ONE date, on focus out the input must be cleared / empty

           const datetimepicker = new tempusDominus.TempusDominus(document.getElementById('input_date_range'), {
        dateRange: true,
        multipleDatesSeparator: " - ",
        display: {
            sideBySide: true
        }
    });

StackBlitz fork

https://stackblitz.com/edit/tempus-dominus-v6-simple-setup-hhldxe?file=index.js,index.html

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Firefox

What version of are you using? You can find this information from the sample StackBlitz.

v6

What your browser's locale? You can find this information from the sample StackBlitz.

it-IT

hkvstore commented 3 months ago

On the other hand, I believe the CSS during selecting the second date is wrong, is it intentional? I personally feel that the rounded border directions are reversed, e.g.

Screenshot 2024-07-02 170741

Screenshot 2024-07-02 170756

Screenshot 2024-07-02 170810