From b1d76150ecc100bf30562e91a38f68ed942fb174 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 30 Apr 2010 19:02:14 +0000 Subject: [PATCH] [ZF-8970] Zend_Validate: - added new section for Zend_Validate_Date git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22066 44c647ce-9c0f-0410-b52a-842ac1e357ba --- .../manual/en/module_specs/Zend_Validate-Date.xml | 108 +++++++++++++++++++++ .../manual/en/module_specs/Zend_Validate-Set.xml | 14 +-- 2 files changed, 109 insertions(+), 13 deletions(-) create mode 100644 documentation/manual/en/module_specs/Zend_Validate-Date.xml diff --git a/documentation/manual/en/module_specs/Zend_Validate-Date.xml b/documentation/manual/en/module_specs/Zend_Validate-Date.xml new file mode 100644 index 000000000..7f5f8834c --- /dev/null +++ b/documentation/manual/en/module_specs/Zend_Validate-Date.xml @@ -0,0 +1,108 @@ + + + + Date + + + Zend_Validate_Date allows you to validate if a given value contains + a date. This validator validates also localized input. + + + + Supported options for Zend_Validate_Date + + + The following options are supported for Zend_Validate_Date: + + + + + + format: Sets the format which is used + to write the date. + + + + + + locale: Sets the locale which will be + used to validate date values. + + + + + + + Default date validation + + + The easiest way to validate a date is by using the default date format. It is used when + no locale and no format has been given. + + + isValid('2000-10-10'); // returns true +$validator->isValid('10.10.2000'); // returns false +]]> + + + The default date format for Zend_Validate_Date is 'yyyy-MM-dd'. + + + + + Localized date validation + + + Zend_Validate_Date validates also dates which are given in a + localized format. By using the locale option you can define the + locale which the date format should use for validation. + + + 'de')); + +$validator->isValid('10.Feb.2010'); // returns true +$validator->isValid('10.May.2010'); // returns false +]]> + + + The locale option sets the default date format. In the above + example this is 'dd.MM.yyyy' which is defined as default date format for 'de'. + + + + + Self defined date validation + + + Zend_Validate_Date supports also self defined date formats. + When you want to validate such a date you can use the format + option. + + + 'yyyy')); + +$validator->isValid('2010'); // returns true +$validator->isValid('May'); // returns false +]]> + + + Of course you can combine format and locale. + In this case you can also use localized month or daynames. + + + 'yyyy MMMM', 'locale' => 'de)); + +$validator->isValid('2010 Dezember'); // returns true +$validator->isValid('2010 June'); // returns false +]]> + + + diff --git a/documentation/manual/en/module_specs/Zend_Validate-Set.xml b/documentation/manual/en/module_specs/Zend_Validate-Set.xml index 06d567a4a..18b6ead9e 100644 --- a/documentation/manual/en/module_specs/Zend_Validate-Set.xml +++ b/documentation/manual/en/module_specs/Zend_Validate-Set.xml @@ -27,19 +27,7 @@ - - Date - - - Returns TRUE if $value is a valid date of the - format 'YYYY-MM-DD'. If the optional locale option is set then the - date will be validated according to the set locale. And if the optional - format option is set this format is used for the validation. for - details about the optional parameters see Zend_Date::isDate(). - - - + -- 2.11.4.GIT