library atk-attribute-yearmonth
ATK Attribute to handle year/month entries in the form YYYY-MM
sanotto/atk-attribute-yearmonth
ATK Attribute to handle year/month entries in the form YYYY-MM
- Monday, July 24, 2017
- by sanotto
- Repository
- 1 Watchers
- 0 Stars
- 21 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 11 % Grown
Year Month Attribute
A YYYY-MM/YYYYMM attribute for ATK9
This attribute lets you specify a month of a year in the following formats:, (*1)
Using
Use it as any other atk Attribute with, (*2)
$this->add(new YearMonthAttribute('period', AF_OBLIGATORY));
Why not using a simple numeric attribute instead of this?
Well, using YearMonth attribute will asure you that:, (*3)
- No years below 1900 and above 2200 are entered.
- No month above 12 (i.e. 201714 will not be deemed valid).
Data base store type
The value will be stored in an int column in the form YYYYMM where:, (*4)
- YYYY Is the year in 4 digits precision (i.e. 2017)
- MM is the month
Thus 201701 is lower than 201702 and higher than 201612., (*5)
dev-master
9999999-dev
ATK Attribute to handle year/month entries in the form YYYY-MM
Sources
Download
MIT
The Requires
framework
skeleton
search
atk
1.0.0
1.0.0.0
ATK Attribute to handle year/month entries in the form YYYY-MM
Sources
Download
MIT
The Requires
framework
skeleton
search
atk