Semantic-UI-Calendar icon indicating copy to clipboard operation
Semantic-UI-Calendar copied to clipboard

'clear' behavior doesn't unset shaded range in popup

Open tirdadc opened this issue 7 years ago • 1 comments

I currently have a setup with two fields, #start_date and #end_date.

When selecting a start date, I set the end_date's start date using set startDate, and vice versa for the end date field.

I am trying to clear all these settings with this code, but it still shows shading in the calendar popup after all of these steps:

$('#start_date').val('');
$('#end_date').val('');

$('#start_date').calendar('clear');
$('#start_date').calendar('set endDate', undefined);
$('#start_date').calendar('set focusDate', undefined);
$('#start_date').calendar('refresh');

$('#end_date').calendar('clear');
$('#end_date').calendar('set startDate', undefined);
$('#end_date').calendar('set focusDate', undefined);
$('#end_date').calendar('refresh');

I expect this for my start date calendar popup when I reset these things:

screen shot 2017-03-29 at 2 21 50 pm

but I end up with this:

screen shot 2017-03-29 at 2 22 07 pm

What's missing? Neither set focusDate nor clear seem to do what I need them to do here.

tirdadc avatar Mar 29 '17 18:03 tirdadc

Your example code works for me, see https://jsbin.com/lasoqomose/edit?html,js,output. Could you please provide a JSBin that reproduces the issue?

mdehoog avatar Apr 09 '17 00:04 mdehoog