@@ -483,6 +483,28 @@ <h3>References</h3>
483483 generateTimes ( '#node-input-startTime' , sunCalcTimes , false )
484484 generateTimes ( '#node-input-endTime' , sunCalcTimes , true )
485485 } )
486+ . fail ( ( ) => {
487+ const sunCalcTimes = [
488+ { "id" :"5101" , "label" :"Sunrise" } ,
489+ { "id" :"5102" , "label" :"Sunrise end" } ,
490+ { "id" :"5103" , "label" :"Golden hour end" } ,
491+ { "id" :"5104" , "label" :"Solar noon" } ,
492+ { "id" :"5105" , "label" :"Golden hour" } ,
493+ { "id" :"5106" , "label" :"Sunset start" } ,
494+ { "id" :"5107" , "label" :"Sunset" } ,
495+ { "id" :"5108" , "label" :"Dusk" } ,
496+ { "id" :"5109" , "label" :"Nautical dusk" } ,
497+ { "id" :"5110" , "label" :"Night" } ,
498+ { "id" :"5111" , "label" :"Nadir" } ,
499+ { "id" :"5112" , "label" :"Night end" } ,
500+ { "id" :"5113" , "label" :"Nautical dawn" } ,
501+ { "id" :"5114" , "label" :"Dawn" } ,
502+ { "id" :"5115" , "label" :"Moonrise" } ,
503+ { "id" :"5116" , "label" :"Moonset" }
504+ ]
505+ generateTimes ( '#node-input-startTime' , sunCalcTimes , false )
506+ generateTimes ( '#node-input-endTime' , sunCalcTimes , true )
507+ } )
486508
487509 offsetEnable ( $ ( '#node-input-startTime' ) . val ( ) , '#node-input-startOffset' )
488510 offsetEnable ( $ ( '#node-input-endTime' ) . val ( ) , '#node-input-endOffset' )
@@ -565,11 +587,15 @@ <h3>References</h3>
565587 `
566588 let sunCalc = ''
567589 for ( const item of sunMoon ) {
568- const time = new Date ( item . date )
569- const hour = leadingZero ( time . getHours ( ) )
570- const minute = leadingZero ( time . getMinutes ( ) )
571- const tString = `${ hour } :${ minute } `
572- sunCalc += `<option value="${ item . id } ">${ tString } - ${ item . label } </option>`
590+ if ( item . date ) {
591+ const time = new Date ( item . date )
592+ const hour = leadingZero ( time . getHours ( ) )
593+ const minute = leadingZero ( time . getMinutes ( ) )
594+ const tString = `${ hour } :${ minute } `
595+ sunCalc += `<option value="${ item . id } ">${ tString } - ${ item . label } </option>`
596+ } else {
597+ sunCalc += `<option value="${ item . id } ">${ item . label } </option>`
598+ }
573599 }
574600
575601 html += `
0 commit comments