Commit 013452b
authored
Ensure Milestone due_on always gets set to desired date (#133)
The "Should have the expected due_on date" UT was failing, but
only at certain times of the day. Further investigation uncovered
this support forum post:
https://github.community/t5/How-to-use-Git-and-GitHub/Milestone-quot-Due-On-quot-field-defaults-to-7-00-when-set-by-v3/m-p/6901
In the event that the post goes away at some point, I will archive
what it says here:
> This is an artifact of how GitHub was originally designed.
> To my recollection, all timestamps in the database are
> normalized to Pacific time. So yes, this is the expected behavior.
> [The time used will vary] because midnight Pacific time is
> 7AM or 8AM UTC time depending on whether Pacific time is in
> daylight savings or not on that date.
Given this information, the problem was then quite clear.
Examples:
* If you set 'due_on' to be '2020-09-24T06:59:00Z',
GitHub considers that to be '2020-09-23T07:00:00Z'
(the previous day!!)
* And if you set 'due_on' to be '2020-09-24T07:01:00Z',
GitHub considers that to be '2020-09-24T07:00:00Z'
(the correct day)
Given this, I've modified `New-GitHubMilestone` and `Set-GitHubMilestone`
to drop the user's provided time (since GitHub does that anyway), and
instead always add 9 hours from midnight (UTC) to the provided
date, which bypasses having to check if we're in daylight savings time
or not.
I then added two additional UT's to ensure we don't lose that functionality.
Finally, I updated the documentation in those methods to try to make it more
clear to users what is going to happen with the date/time that they provide.
Fixes #921 parent f9122db commit 013452b
2 files changed
Lines changed: 73 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| |||
190 | 194 | | |
191 | 195 | | |
192 | 196 | | |
| 197 | + | |
| 198 | + | |
193 | 199 | | |
194 | 200 | | |
195 | 201 | | |
| |||
205 | 211 | | |
206 | 212 | | |
207 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
208 | 226 | | |
209 | 227 | | |
210 | 228 | | |
| |||
265 | 283 | | |
266 | 284 | | |
267 | 285 | | |
268 | | - | |
269 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
270 | 295 | | |
271 | 296 | | |
272 | 297 | | |
| |||
318 | 343 | | |
319 | 344 | | |
320 | 345 | | |
| 346 | + | |
| 347 | + | |
321 | 348 | | |
322 | 349 | | |
323 | 350 | | |
| |||
333 | 360 | | |
334 | 361 | | |
335 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
336 | 375 | | |
337 | 376 | | |
338 | 377 | | |
| |||
398 | 437 | | |
399 | 438 | | |
400 | 439 | | |
401 | | - | |
402 | | - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
403 | 449 | | |
404 | 450 | | |
405 | 451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| |||
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| 51 | + | |
| 52 | + | |
45 | 53 | | |
46 | 54 | | |
47 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
48 | 68 | | |
49 | 69 | | |
50 | 70 | | |
| |||
55 | 75 | | |
56 | 76 | | |
57 | 77 | | |
58 | | - | |
| 78 | + | |
59 | 79 | | |
60 | 80 | | |
61 | 81 | | |
| |||
69 | 89 | | |
70 | 90 | | |
71 | 91 | | |
72 | | - | |
| 92 | + | |
73 | 93 | | |
74 | 94 | | |
75 | 95 | | |
| |||
87 | 107 | | |
88 | 108 | | |
89 | 109 | | |
90 | | - | |
| 110 | + | |
91 | 111 | | |
92 | 112 | | |
93 | 113 | | |
| |||
0 commit comments