iz
Clone
https://git.tahinli.com/Tahinli/iz.git
0 watching0 forksRustAGPL-3.0567.3 KiB3950aceTahinli27 days ago34 commits
| 1 | //! Deadline and meeting-time rules (docs/reference/old-inventory.md 2.4), on real IANA zones through |
| 2 | //! `zones.rs`. A task has a deadline day, a meeting instant, or both. The user types a day and an |
| 3 | //! optional `HH:MM` in their own zone; this module turns that into the values the store keeps. |
| 4 | //! |
| 5 | //! Rules: a time needs a day; hour and minute are both given or neither; a meeting sets the deadline |
| 6 | //! day to the meeting's local day. A local time that does not exist (DST gap) or happens twice |
| 7 | //! (DST overlap) is refused, because the user has to choose. |
| 8 | |
| 9 | use Date; |
| 10 | use TimeZone; |
| 11 | use ; |
| 12 | use OffsetDateTime; |
| 13 | |
| 14 | use crate; |
| 15 | use crateformat_stamp; |
| 16 | use crate; |
| 17 | |
| 18 | /// How long before a meeting its reminder is due, in minutes, when the setting was never saved. |
| 19 | pub const REMINDER_LEAD_MINUTES: i64 = 15; |
| 20 | |
| 21 | /// What the user typed for a deadline and meeting time. Every part is optional. |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | /// Validates the input and resolves it to the stored values: the deadline day and the meeting as a |
| 33 | /// UTC stamp (the fixed-width format of `time::format_stamp`). Errors are `Invalid` and name the rule. |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | /// The stored stamp of an instant. Fails only for instants outside the range of `time`. |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | /// Parses a stored stamp back into an instant for comparisons. |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | /// The moment a reminder for a meeting at `meeting` is due: `lead_minutes` before it. The lead comes from |
| 71 | /// the `reminder_minutes` setting (0 turns reminders off, so the caller never asks for a due time then). |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 |