AnsweredAssumed Answered

Date Validation in Aikau widget

Question asked by anshu.kumar on Mar 1, 2016
Latest reply on Oct 25, 2016 by tansadio
Hello Guys,

I have a very basic requirement for which I am using Aikau widgets to develop.
The requirement is to have a form based selection of 'FROM' and 'To' dates. I am able to populate the Date textbox using "alfresco/forms/controls/DateTextBox" widget. However, I need to put a validation in which 'from' date should always be less than 'to'. Can someone help me achieve this. Thanks. Below is the piece of code that shows the dates selection.

<javascript>
var date = new Date();
var todayDate = date.toISOString();

model.jsonModel = {
   
    widgets: [
   {
      id: "FROM_DATE",
      name: "alfresco/forms/controls/DateTextBox",
      config:   {
         label: "FROM",
         name: "fromDate",
         value: todayDate
      }
    },
   {
      id: "TO_DATE",
      name: "alfresco/forms/controls/DateTextBox",
      config:   {
         label: "TO",
         name: "toDate",
         value: todayDate
      }
    }   
]};
</javascript>

Outcomes