'Chosen label is not changing after cancel button in ng2-daterangepicker

Using n2-daterangepicker. Facing two problems.

screenshot of date picker

  1. When select custom range its not changing the chosen label change
  2. If applied cancel button and then click custom date and apply dates, chosenlabel detecting as ALL DATES
    if (e.picker.chosenLabel === 'All Dates') {
          
    } else if (e.picker.chosenLabel === 'Today') {
          
    } else {
          
    }

If conditions are used to check chosen label. After cancel, that daterange picker not hiding from the UI



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source