DateDict.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\dict\sys;
  12. /**
  13. * 日期的字典
  14. */
  15. class DateDict
  16. {
  17. public const MON = 1;
  18. public const TUE = 2;
  19. public const WED = 3;
  20. public const THUR = 4;
  21. public const FRI = 5;
  22. public const SAT = 6;
  23. public const SUN = 0;
  24. public const JAN = 1;
  25. public const FEB = 2;
  26. public const MAR = 3;
  27. public const APR = 4;
  28. public const MAY = 5;
  29. public const JUN = 6;
  30. public const JUL = 7;
  31. public const AUG = 8;
  32. public const SEPT = 9;
  33. public const OCT = 10;
  34. public const NOV = 11;
  35. public const DEC = 12;
  36. /**
  37. * 星期
  38. * @return array
  39. */
  40. public static function getWeek()
  41. {
  42. return [
  43. self::MON => get_lang('dict_date.mon'),//周一
  44. self::TUE => get_lang('dict_date.tue'),//周二
  45. self::WED => get_lang('dict_date.wed'),//周三
  46. self::THUR => get_lang('dict_date.thur'),//周四
  47. self::FRI => get_lang('dict_date.fri'),//周五
  48. self::SAT => get_lang('dict_date.sat'),//周六
  49. self::SUN => get_lang('dict_date.sun'),//周日
  50. ];
  51. }
  52. /**
  53. * 月份
  54. * @return array
  55. */
  56. public function getMonth()
  57. {
  58. return [
  59. self::JAN => get_lang('dict_date.jan'),//1月
  60. self::FEB => get_lang('dict_date.feb'),//2月
  61. self::MAR => get_lang('dict_date.mar'),//3月
  62. self::APR => get_lang('dict_date.apr'),//4月
  63. self::MAY => get_lang('dict_date.may'),//5月
  64. self::JUN => get_lang('dict_date.jun'),//6月
  65. self::JUL => get_lang('dict_date.jul'),//7月
  66. self::AUG => get_lang('dict_date.aug'),//8月
  67. self::SEPT => get_lang('dict_date.sept'),//9月
  68. self::OCT => get_lang('dict_date.oct'),//10月
  69. self::NOV => get_lang('dict_date.nov'),//11月
  70. self::DEC => get_lang('dict_date.dec'),//12月
  71. ];
  72. }
  73. }