Ticket #359 (closed task: fixed)

Opened 2 years ago

Last modified 23 months ago

Improve validators

Reported by: david Owned by: dominik
Priority: high Milestone: 0.11
Component: validation Version:
Severity: blocker Keywords:
Cc: Patch attached:

Description

  • Add ability to cast types whereever feasible
  • Integrate with i18n

Concrete tasks:

  • Number Validation
    • Allow "only int", "only float" or "both" modes
    • Allow casting of values to int or float
    • Make casting optionally disableable
    • Automatically use the current locale information to parse values, i.e. "5,14" instead of "5.14" for German and others
    • Allow overriding of the locale used to parse the information
    • Allow disabling of automatic locale use
  • Date/Time Validation
    • Get rid of mktimestamp validator
    • Build one validator for date, time and datetime validation
    • Can parse from one field or multiple fields
    • Can normalize values (d, m and y field to one value or other way round)
    • Can cast values (to unix timestamp, to formatted string, to to Calendar object, maybe PHP 5.2 DateTime? object?)
    • Automatically use the current locale information to parse values, i.e. "01.12.2006" instead of "12/01/06" for German
    • Allow overriding of the locale used to parse the information
    • Allow disabling of automatic locale use
    • Allow specifying the name of a parameter given to each locale that contains a parse format string

Attachments

Change History

Changed 23 months ago by dominik

(In [1463]) add in_locale, no_locale and cast_to parameters to the number validator

refs #359

Changed 23 months ago by dominik

(In [1482]) BREAKING CHANGE! rewrite date validator to contain the stuff in the ticket to see what the new parameters are check the phpdoc refs #359

Changed 23 months ago by dominik

(In [1484]) add minimum and maximum constraints for the date validator (allows referencing already validated dates too) refs #359

Changed 23 months ago by dominik

  • status changed from new to closed
  • resolution set to fixed

(In [1485]) BREAKING CHANGE! removed mktimestamp validator and time validator. This stuff can be accomplished with the date validator now closes #359

Add/Change #359 (Improve validators)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.