Yii Framework Forum: Datecomparevalidator - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Datecomparevalidator Rate Topic: -----

#1 User is offline   Frank He 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 13-June 13

Posted 14 November 2013 - 07:26 PM

Hey,

I just created a new extension to validate date and ensure date in a specified range.
Details as below:

YiiDateCompareValidator (Source code can be found in Github YiiDateCompareValidator project)
====================================================
DateCompareValidator for Yii
This extension validate a date and ensure it is between min and max date if set

Requirements
This extension has been tested with Yii Framework 1.1.14

Usage
Place the extension in your protected\extensions directory and add it to your model like the following:

public function rules() { return array( array('expiry', 'ext.DateCompareValidator', 'allowEmpty'=>true, 'format'=>'dd/MM/yyyy', 'min'=>date('d/m/Y'), 'max'=>'01/01/2014'), ); }
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users