In wj-input-date the min property is not working

Posted by: parmarkinjalk on 7 May 2019, 1:19 pm EST

    • Post Options:
    • Link

    Posted 7 May 2019, 1:19 pm EST

    Hi,

    I am using Wijmo Library 5.20163.234 with Angular 1.6. I am trying to use the min property but its not working, please see the code

    <wj-input-date ng-disabled="isDialog=='Y' && job.jobStatus!='Draft'" value="job.jobAwardedDate" format="MM/dd/yyyy"
    							placeholder="MM/dd/yyyy" style="width:200px" name="jobAwardedDate" min="firstDay"></wj-input-date>
    

    JavaScript Code

    $scope.todaysDate = new Date();
    				$scope.firstDay = new Date($scope.todaysDate.setDate($scope.todaysDate.getDate()));
    

    javascript code is giving me the value

    [date] Tue May 07 2019 13:07:03 GMT-0400 (Eastern Daylight Time)[date] Tue May 07 2019 13:07:03 GMT-0400 (Eastern Daylight Time)

  • Posted 8 May 2019, 4:52 am EST

    Hi,

    When assigning min/max using the template then min/max needs to be the string in the format “yyyy-MM-dd”.

    API reference: https://www.grapecity.com/wijmo/api/classes/wijmo_angular_input.wjinputdate.html

    If you need to assign date object for min/max then you need to assign the values to the min/max properties on the actual control instance. Please refer to the following code snippet:

    <wj-input-date initialized="init(s)"></wj-input-date>
    // in controller
     $scope.init = function(s){
      	s.min = new Date();
      }
    

    ~sharad

  • Posted 8 May 2019, 10:46 am EST

    It Worked, Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels