sanotto/atk-attribute-yearmonth
Composer 安装命令:
composer require sanotto/atk-attribute-yearmonth
包简介
ATK Attribute to handle year/month entries in the form YYYY-MM
README 文档
README
A YYYY-MM/YYYYMM attribute for ATK9
This attribute lets you specify a month of a year in the following formats:
- YYYYMM
Using
Use it as any other atk Attribute with
$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:
- 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:
- 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.
统计信息
- 总下载量: 44
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-24