2017 © Pedro Peláez
 

yii2-extension yii2-datetime-compare-validator

Yii2 validator for compare datetime.

image

nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  • Wednesday, September 14, 2016
  • by nepstor
  • Repository
  • 2 Watchers
  • 10 Stars
  • 8,491 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 6 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

yii2-datetime-compare-validator

Validator for yii2 allows you to compare dates., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require nepstor/yii2-datetime-compare-validator "^2.0"

or add, (*4)

"nepstor/yii2-datetime-compare-validator": "^2.0"

to the require section of your composer.json file., (*5)

Using

public function rules()
{
    return [
        ['begin', nepstor\validators\DateTimeCompareValidator::className(), 'compareAttribute' => 'end', 'format' => 'Y-m-d', 'operator' => '>=']
    ];
}

Properties

This validator compares the specified input datetime with another one and make sure if their relationship is as specified by the operator property., (*6)

  • compareAttribute: the name of the attribute whose value should be compared with.
  • compareValue: a constant value that the input value should be compared with. When both of this property and compareAttribute are specified, this property will take precedence.
  • operator: the comparison operator. Defaults to =. The following operators are supported:
    • =: check if two values are equal. The comparison is done is non-strict mode.
    • !=: check if two values are NOT equal. The comparison is done is non-strict mode.
    • >: check if value being validated is greater than the value being compared with.
    • >=: check if value being validated is greater than or equal to the value being compared with.
    • <: check if value being validated is less than the value being compared with.
    • <=: check if value being validated is less than or equal to the value being compared with.
  • format: Date format to parse values with. Defaults to Y-m-d.
  • jsFormat: Date format to parse values with client side. Defaults to YYYY-MM-DD.

The Versions

14/09 2016

dev-master

9999999-dev https://github.com/nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Nikita Krytskiy

extension yii2 validator datetime datetime compare

14/09 2016

2.0.3

2.0.3.0 https://github.com/nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Nikita Krytskiy

extension yii2 validator datetime datetime compare

13/04 2016

2.0.2

2.0.2.0 https://github.com/nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Nikita Krytskiy

extension yii2 validator datetime datetime compare

21/02 2016

2.0.1

2.0.1.0 https://github.com/nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Nikita Krytskiy

extension yii2 validator datetime datetime compare

21/02 2016

2.0.0

2.0.0.0 https://github.com/nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Nikita Krytskiy

extension yii2 validator datetime datetime compare

21/01 2016

1.1.0

1.1.0.0 https://github.com/nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  Sources   Download

BSD-3-Clause

The Requires

 

by Nikita Krytskiy

extension yii2 validator datetime

03/12 2015

1.0.0

1.0.0.0 https://github.com/nepstor/yii2-datetime-compare-validator

Yii2 validator for compare datetime.

  Sources   Download

BSD-3-Clause

The Requires

 

by Nikita Krytskiy

extension yii2 validator datetime