File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,18 @@ export class Occurrence {
5555 * @private
5656 */
5757 private getReferenceDate ( ) : Moment | null {
58+ const datesInPriorityOrder = this . getDatePriorityOrder ( ) ;
59+
60+ for ( const date of datesInPriorityOrder ) {
61+ if ( date ) {
62+ return window . moment ( date ) ;
63+ }
64+ }
65+
66+ return null ;
67+ }
68+
69+ private getDatePriorityOrder ( ) : ( Moment | null ) [ ] {
5870 const datesInPriorityOrder : ( Moment | null ) [ ] = [ ] ;
5971
6072 datesInPriorityOrder . push ( this . dueDate ) ;
@@ -71,14 +83,7 @@ export class Occurrence {
7183 datesInPriorityOrder . push ( this . scheduledDate ) ;
7284 datesInPriorityOrder . push ( this . startDate ) ;
7385 }
74-
75- for ( const date of datesInPriorityOrder ) {
76- if ( date ) {
77- return window . moment ( date ) ;
78- }
79- }
80-
81- return null ;
86+ return datesInPriorityOrder ;
8287 }
8388
8489 public isIdenticalTo ( other : Occurrence ) : boolean {
You can’t perform that action at this time.
0 commit comments