'how can I enable only certain dates with formly date-mask

We are working on an Angular application that uses formly forms. I have a requirement to create a date-mask or datemask-input field that, under certain conditions, the user can select only the first of the month or the last of the month (but it can be any month and any year).

So far I've got this:

{
  "id": "...",
  "key": "theDate",
  "type": "date-mask",
  "templateOptions": {
    "dateFormat": "YYYY-MM-DD",
    "outputString": true,
    "required": true
  }
}

What else do I need to add to have only the 1st and last date of each month enabled?

Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source