Blog Sections Open

Making FormIt `isDate` Work with Russian Month and Weekday Names

If FormIt validates English date tokens but your frontend emits Russian month or weekday names, the fix usually belongs in normalization, not in the form markup alone.

Date validation gets tricky as soon as localization enters the picture. The old problem here was a FormIt rule like this:

date-in:required:isDate=^%D %dd %MM %yy^:stripTags

paired with a UI date format such as:

dateFormat: 'D, dd MM yy'

That works cleanly when tokens match the expected language, but localized month or weekday names can break validation.

Why It Happens

The validator may be reading a language-neutral or English-oriented format, while the frontend datepicker is producing localized text. Once those two disagree, valid human dates fail machine validation.

What Works Better

  • normalize the incoming value into a stable machine format before validation
  • validate against a non-localized storage format
  • only localize the display layer, not the canonical submitted value

Best Practice

Use one format for humans and one for the application. Let the UI show localized month names if needed, but transform the submitted value into a stable format such as YYYY-MM-DD before the real validation step runs.

Newer post

Why WebLoginPE Registration Can Fail Even When the Form Looks Correct

A practical checklist for WebLoginPE registration failures, especially when instant registration is enabled and the form submits but the user is not created.

Older post

Reloading an eForm After Successful Submission

How to keep an eForm visible and ready for another submission instead of replacing it permanently with a success message.