You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DayOfMonth.php 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace App\Enums\Accounting;
  3. use App\Enums\Concerns\ParsesEnum;
  4. use Filament\Support\Contracts\HasLabel;
  5. enum DayOfMonth: int implements HasLabel
  6. {
  7. use ParsesEnum;
  8. case First = 1;
  9. case Last = -1;
  10. case Second = 2;
  11. case Third = 3;
  12. case Fourth = 4;
  13. case Fifth = 5;
  14. case Sixth = 6;
  15. case Seventh = 7;
  16. case Eighth = 8;
  17. case Ninth = 9;
  18. case Tenth = 10;
  19. case Eleventh = 11;
  20. case Twelfth = 12;
  21. case Thirteenth = 13;
  22. case Fourteenth = 14;
  23. case Fifteenth = 15;
  24. case Sixteenth = 16;
  25. case Seventeenth = 17;
  26. case Eighteenth = 18;
  27. case Nineteenth = 19;
  28. case Twentieth = 20;
  29. case TwentyFirst = 21;
  30. case TwentySecond = 22;
  31. case TwentyThird = 23;
  32. case TwentyFourth = 24;
  33. case TwentyFifth = 25;
  34. case TwentySixth = 26;
  35. case TwentySeventh = 27;
  36. case TwentyEighth = 28;
  37. case TwentyNinth = 29;
  38. case Thirtieth = 30;
  39. case ThirtyFirst = 31;
  40. public function getLabel(): ?string
  41. {
  42. return match ($this) {
  43. self::First => 'First',
  44. self::Last => 'Last',
  45. self::Second => '2nd',
  46. self::Third => '3rd',
  47. self::Fourth => '4th',
  48. self::Fifth => '5th',
  49. self::Sixth => '6th',
  50. self::Seventh => '7th',
  51. self::Eighth => '8th',
  52. self::Ninth => '9th',
  53. self::Tenth => '10th',
  54. self::Eleventh => '11th',
  55. self::Twelfth => '12th',
  56. self::Thirteenth => '13th',
  57. self::Fourteenth => '14th',
  58. self::Fifteenth => '15th',
  59. self::Sixteenth => '16th',
  60. self::Seventeenth => '17th',
  61. self::Eighteenth => '18th',
  62. self::Nineteenth => '19th',
  63. self::Twentieth => '20th',
  64. self::TwentyFirst => '21st',
  65. self::TwentySecond => '22nd',
  66. self::TwentyThird => '23rd',
  67. self::TwentyFourth => '24th',
  68. self::TwentyFifth => '25th',
  69. self::TwentySixth => '26th',
  70. self::TwentySeventh => '27th',
  71. self::TwentyEighth => '28th',
  72. self::TwentyNinth => '29th',
  73. self::Thirtieth => '30th',
  74. self::ThirtyFirst => '31st',
  75. };
  76. }
  77. }