Non-date value for date-picker

4 posts, 0 answers
  1. Taras
    Taras avatar
    39 posts
    Member since:
    May 2015

    Posted 09 May Link to this post

    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");
                }





  2. Stefan
    Admin
    Stefan avatar
    1131 posts

    Posted 11 May Link to this post

    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.
  3. Taras
    Taras avatar
    39 posts
    Member since:
    May 2015

    Posted 11 May in reply to Stefan Link to this post

    Hello Stefan!
    'value' method in your example is used only during initializating,
    what about changing 'value' after initialization? Could you try this case, please?
  4. Stefan
    Admin
    Stefan avatar
    1131 posts

    Posted 15 May Link to this post

    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.
Back to Top