Commit 101a1e0
authored
Fix: Calculation for occurrences include DST transitions correctly (#673)
* Fix: Calculation for occurrences include DST transitions correctly
Updated `CalendarEvent` and `EventEvaluator` to enhance event handling,
particularly around time zones and daylight saving time transitions.
Key changes include:
- Enabled nullable reference types in `CalendarEvent` and `EventEvaluator.`
- Updated `CalendarEvent` to throw `InvalidOperationException` when trying to set both `DtEnd` and `Duration`.
- Event end time and duration calculations in `EventEvaluator` reflect any DST transitions.
- Added new test class `RecurrenceTests_From_Issues` to validate changes with various edge cases and scenarios.
Resolves #660
Resolves #623
Resolves #671
Resolves #567
Resolves #342
Resolves #298
* Refactor and improve Period class and related usages
`CalendarEvent`
- Renamed `CalcFirstNominalDuration` to `GetTimeSpanToAddToPeriodStartTime`. The logic remains unchanged.
`Period`
- Removed private `ExtrapolateTimes()` method
- Enabled nullable reference types
- Refactored constructors and properties
- Added `GetOriginalValues` method
- Enhanced documentation and exception handling
- Fixed bug in `CollidesWith(Period)`
- Added PeriodTests.cs to cover unit tests for `Period` class.
- Shortcoming: `Period.Duration` may still implicitly return a nominal or an exact duration.
* Make `CalendarEvent.GetTimeSpanToAddToPeriodStartTime()` internal1 parent 4c1de35 commit 101a1e0
File tree
11 files changed
+1016
-288
lines changed- Ical.Net.Tests
- Ical.Net
- CalendarComponents
- DataTypes
- Evaluation
11 files changed
+1016
-288
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
455 | 457 | | |
456 | 458 | | |
457 | | - | |
| 459 | + | |
| 460 | + | |
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| |||
472 | 475 | | |
473 | 476 | | |
474 | 477 | | |
475 | | - | |
| 478 | + | |
476 | 479 | | |
477 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
478 | 483 | | |
479 | | - | |
| 484 | + | |
480 | 485 | | |
481 | | - | |
482 | | - | |
| 486 | + | |
| 487 | + | |
483 | 488 | | |
484 | 489 | | |
485 | 490 | | |
486 | 491 | | |
487 | | - | |
488 | | - | |
489 | | - | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
490 | 495 | | |
491 | 496 | | |
492 | | - | |
| 497 | + | |
493 | 498 | | |
494 | | - | |
495 | | - | |
| 499 | + | |
| 500 | + | |
496 | 501 | | |
497 | 502 | | |
498 | 503 | | |
499 | 504 | | |
500 | | - | |
501 | | - | |
| 505 | + | |
| 506 | + | |
502 | 507 | | |
503 | 508 | | |
504 | | - | |
| 509 | + | |
505 | 510 | | |
506 | | - | |
| 511 | + | |
507 | 512 | | |
508 | 513 | | |
509 | 514 | | |
510 | 515 | | |
511 | | - | |
512 | | - | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
513 | 519 | | |
514 | 520 | | |
515 | | - | |
| 521 | + | |
516 | 522 | | |
517 | | - | |
| 523 | + | |
518 | 524 | | |
519 | 525 | | |
520 | 526 | | |
521 | 527 | | |
522 | | - | |
| 528 | + | |
523 | 529 | | |
524 | | - | |
| 530 | + | |
525 | 531 | | |
526 | 532 | | |
527 | 533 | | |
528 | 534 | | |
529 | | - | |
| 535 | + | |
530 | 536 | | |
531 | 537 | | |
532 | 538 | | |
533 | 539 | | |
534 | | - | |
535 | | - | |
| 540 | + | |
| 541 | + | |
536 | 542 | | |
537 | 543 | | |
538 | 544 | | |
539 | 545 | | |
540 | | - | |
| 546 | + | |
541 | 547 | | |
542 | 548 | | |
543 | 549 | | |
544 | 550 | | |
545 | | - | |
546 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
547 | 571 | | |
548 | 572 | | |
549 | 573 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
199 | 198 | | |
200 | 199 | | |
201 | 200 | | |
202 | | - | |
| 201 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
| |||
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | | - | |
116 | 114 | | |
117 | 115 | | |
118 | 116 | | |
| |||
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
133 | | - | |
134 | 131 | | |
135 | 132 | | |
136 | 133 | | |
| |||
501 | 498 | | |
502 | 499 | | |
503 | 500 | | |
504 | | - | |
| 501 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
0 commit comments