1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
use std::fmt; use crate::*; /// 🝱 - The twelve months of the year /// /// These months are roughly derived from the cycles of the moon. Additionally, months line up with /// various seasons. /// /// I'll add here that, a system of 13 months could work very nicely. Every /// month would have 28 days, and there would only be a single day left over, /// for new years. // // TODO: Update with information about the equinoxes. #[derive(Debug, Eq, PartialEq, Ord, PartialOrd)] pub enum Month { /// ♑ 270° Αἰγόκερως, Capricorn, or Mountain Goat /// /// Named after Janus the beginnings and endings. January, /// ♒ 300° Ὑδροχόος, Aquarius, or Water-Bearer /// /// Named for Februus which was a time of celebrations in Rome. February, /// ♓ 330° Ἰχθύες, Pisces, or Fish /// /// Named after the Mars, the Roman god of war. Despite "Aries" being the next sign, this is in /// part due to the fact that these signs do not correspond directly to the months. March, /// ♈ 0° Κριός, Aries, or Ram /// /// Aprilis the opening of the flowers. April, /// ♉ 30° Ταῦρος, Taurus, or Bull /// /// Maiores, meaning "major" or older. May, /// ♊ 60° Δίδυμοι, Gemini, or Twins /// /// Iuniores, meaning "junior" or the younger. June, /// ♋ 90° Καρκίνος, Cancer, or Crab /// /// Julius, named in 44 BCE, the year of his assassination. July, /// ♌ 120° Λέων, Leo, or Lion /// /// Augustus, a Roman emperor. August, /// ♍ 150° Παρθένος, Virgo, Maiden /// /// Septem, meaning seven. September, /// ♎ 180° Ζυγός, Libra, or Scales /// /// Octo, meaning eight. October, /// ♏ 210° Σκoρπίος, Scorpio, or Scorpion /// /// Novem, meaning nine. November, /// ♐ 240° Τοξότης, Sagittarius, or Archer /// /// Decem, meaning ten. December, // It would seem that the fall of Rome occurred before they could finish // the naming of the months to fruition. } impl From<usize> for Month { fn from(date: usize) -> Month { match date { 1 => January, 2 => February, 3 => March, 4 => April, 5 => May, 6 => June, 7 => July, 8 => August, 9 => September, 10 => October, 11 => November, 12 => December, _ => unreachable!(), } } } impl fmt::Display for Month { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{:?}", self) } }