How to add "date" control type in registration client UI spec?

In MOSIP’s v1.1.5.1 we have added an UI control type called “date” in the registration client UI specification. This attribute can be used to capture date data in registration client.

Instructions

Here are some steps to add “date” control type and special rules related to it.

  1. The value for controlType should be “date“

  2. The minimum and maximum value should be in days

  3. If minimum value is set as “0”, then the minimum value is today, hence, you can capture the date from tomorrow onwards (next day)

  4. If maximum values is set as “40”, then the maximum value is today+40 days, hence, you can not capture date more than 40 days

  5. The value for minimum can be negative

  6. All other properties remain same as other attributes used in registration client UI spec.

Example

Let’s assume that today is 10th March 2021.

The minimum value for your date control type is set as “0” and maximum value is set as “40”.

Then, minimum value that you can capture is 11th March 2021 and maximum value that you can capture is 19th April 2021.

Sample Date Attribute in Registration Client UI Spec

{ "id": "anotherDate", "description": "anotherDate", "label": { "primary": "Another Date" }, "type": "string", "minimum": 0, "maximum": 40, "controlType": "date", "fieldType": "default", "format": "none", "fieldCategory": "pvt", "inputRequired": true, "validators": [ { "type": "regex", "validator": "^(1869|18[7-9][0-9]|19[0-9][0-9]|20[0-9][0-9])/([0][1-9]|1[0-2])/([0][1-9]|[1-2][0-9]|3[01])$", "arguments": [] } ], "bioAttributes": null, "requiredOn": [ { "engine": "MVEL", "expr": "identity.?isNew || (identity.isUpdate && (identity.updatableFieldGroups contains 'GuardianDetails' || identity.updatableFieldGroups contains 'DateOfBirth'))" } ], "subType": "anotherDate", "contactType": null, "group": "DateOfBirth", "alignmentGroup": null, "visible": null, "changeAction": null, "required": true }