This is a migrated thread and some comments may be shown as answers.

Non-date value for date-picker

3 Answers 257 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Taras
Top achievements
Rank 2
Taras asked on 09 May 2017, 06:35 PM
Hello.
We have functionality, which allows to set non-date(string "No due date") value on initialization, and after picking date(see ex. below)
Some time ago(I think it was happened after updating to one of the latest release) this functionality was broken.
Now after setting non-date value datepicker sets current date itself.

How we can repair our functionality? Is any workaround to set non-date value?


Example of our workaround, which now doesn't have effect:

  function setDueDateToNoDueDate() {
                $scope.dueDateWidget.value($scope._noDueDateText);
                $scope.dueDateWidget.element[0].value = $scope._noDueDateText;
                $scope.dueDateWidget.trigger("change");
            }





3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 May 2017, 10:52 AM
Hello Taras,

In general, the Kendo UI DatePicker can receive a non-date value:

http://dojo.telerik.com/aboKE

Still, when the value method is used this will return null as it is not in the min and max range of the widget.

If the demonstrated approach has a different purpose, please provide an example which is reproducing the issue and the older version of Kendo UI, so I can investigate if there are specific changes in regards to this implementation.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Taras
Top achievements
Rank 2
answered on 11 May 2017, 12:15 PM
Hello Stefan!
'value' method in your example is used only during initializating,
what about changing 'value' after initialization? Could you try this case, please?
0
Stefan
Telerik team
answered on 15 May 2017, 06:54 AM
Hello Taras,

Indeed the value of the widget can be set to non-date value only during initialization.

As I can confirm that this is not consistent behaviour, I forwarded it to our developer's team, to check which behaviour is more expected and make it the same for both scenarios.

For now, as a workaround, I can suggest to destroy the widget and recreate again with a non-date value. As this is not a very complex widget, this should not cause big performance issues depending on how many datePickers are affected:

http://docs.telerik.com/kendo-ui/intro/widget-basics/destroy

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Date/Time Pickers
Asked by
Taras
Top achievements
Rank 2
Answers by
Stefan
Telerik team
Taras
Top achievements
Rank 2
Share this question
or