1(function() { 2 let piecalUtils = { 3 getAlldayMultidayEventEnd: function( event ) { 4 if( !event ) return undefined; 5 6 if(event.allDay && event.end) { 7 let eventStart = new Date(event.start); 8 let comparableEventStart = eventStart.toLocaleDateString('en-us'); 9 let eventEnd = new Date(event.end); 10 let comparableEventEnd = eventEnd.toLocaleDateString('en-us'); 11 12 if( comparableEventStart == comparableEventEnd ) return; 13 14 let trueDayNumber = parseInt(event.end.match(/-(\d{2})T/)[1], 10); 15 let convertedDayNumber = eventEnd.getDate(); 16 17 if( convertedDayNumber < trueDayNumber ) { 18 eventEnd.setDate(eventEnd.getDate() + 2); 19 } else if( convertedDayNumber == trueDayNumber ) { 20 eventEnd.setDate(eventEnd.getDate() + 1); 21 } 22 23 let extendedEndDate = eventEnd.toISOString(); 24 25 return { 26 actualEnd: event.end, // Save original event end to use in popover 27 end: extendedEndDate // Change event end to show it extending through the last day 28 } 29 } 30 }, 31 32 getLocalizedDayNames: function( dayName, length, locale = '' ) { 33 if( !length ) return dayName; 34 35 let allowedLengths = ['full', 'short', 'single']; 36 37 if( !allowedLengths.includes(length) ) { 38 return dayName; 39 } 40 41 // Normalize locale before using it to lookup day names in dayNameMap 42 if( locale.includes( "-" ) ) { 43 locale = locale.split("-"); 44 45 locale = locale[0]; 46 } 47 48 let dayNameMap = { 49 // Hebrew 50 "he": { 51 "××× ×¨×ש××": { // Sunday 52 full: "××× ×¨×ש××", 53 short: "×׳", 54 single: "×׳" 55 }, 56 "××× ×©× ×": { // Monday 57 full: "××× ×©× ×", 58 short: "×׳", 59 single: "×׳" 60 }, 61 "××× ×©××ש×": { // Tuesday 62 full: "××× ×©××ש×", 63 short: "×׳", 64 single: "×׳" 65 }, 66 "××× ×¨×××¢×": { // Wednesday 67 full: "××× ×¨×××¢×", 68 short: "×׳", 69 single: "×׳" 70 }, 71 "××× ×××ש×": { // Thursday 72 full: "××× ×××ש×", 73 short: "×׳", 74 single: "×׳" 75 }, 76 "××× ×©×ש×": { // Friday 77 full: "××× ×©×ש×", 78 short: "×׳", 79 single: "×׳" 80 }, 81 "××× ×©×ת": { // Saturday 82 full: "××× ×©×ת", 83 short: "ש׳", 84 single: "ש׳" 85 } 86 }, 87 // Arabic 88 "ar": { 89 "Ø§ÙØ³Ø¨Øª": { // Saturday 90 full: "Ø§ÙØ³Ø¨Øª", 91 short: "س", 92 single: "س" 93 }, 94 "Ø§ÙØ£ØØ¯": { // Sunday 95 full: "Ø§ÙØ£ØØ¯", 96 short: "Ø", 97 single: "Ø" 98 }, 99 "Ø§ÙØ§Ø«ÙÙÙ": { // Monday 100 full: "Ø§ÙØ¥Ø«ÙÙÙ", 101 short: "Ù", 102 single: "Ù" 103 }, 104 "Ø§ÙØ«Ùاثاء": { // Tuesday 105 full: "Ø§ÙØ«Ùاثاء", 106 short: "Ø«", 107 single: "Ø«" 108 }, 109 "Ø§ÙØ£Ø±Ø¨Ø¹Ø§Ø¡": { // Wednesday 110 full: "Ø§ÙØ£Ø±Ø¨Ø¹Ø§Ø¡", 111 short: "ر", 112 single: "ر" 113 }, 114 "Ø§ÙØ®Ù ÙØ³": { // Thursday 115 full: "Ø§ÙØ®Ù ÙØ³", 116 short: "Ø®", 117 single: "Ø®" 118 }, 119 "Ø§ÙØ¬Ù عة": { // Friday 120 full: "Ø§ÙØ¬Ù عة", 121 short: "ج", 122 single: "ج" 123 }, 124 }, 125 // Icelandic 126 // Not supported by intl.DateTimeFormat, so we add it ourselves here 127 "is": { 128 "Monday": { 129 full: "Mánudagur", 130 short: "Mán", 131 single: "M" 132 }, 133 "Tuesday": { 134 full: "Ãriðjudagur", 135 short: "Ãri", 136 single: "Ã", 137 }, 138 "Wednesday": { 139 full: "Miðvikudagur", 140 short: "Mið", 141 single: "M" 142 }, 143 "Thursday": { 144 full: "Fimmtudagur", 145 short: "Fim", 146 single: "F" 147 }, 148 "Friday": { 149 full: "Föstudagur", 150 short: "Fös", 151 single: "F" 152 }, 153 "Saturday": { 154 full: "Laugardagur", 155 short: "Lau", 156 single: "L" 157 }, 158 "Sunday": { 159 full: "Sunnudagur", 160 short: "Sun", 161 single: "S" 162 } 163 } 164 } 165 166 if (!(locale in dayNameMap) || 167 ( !dayNameMap[locale][dayName] || 168 !dayNameMap[locale][dayName][length] ) ) { 169 switch( length ) { 170 case "full": 171 return dayName; 172 case "short": 173 return dayName.substring(0, 3); 174 case "single": 175 return dayName.substring(0, 1); 176 } 177 } 178 179 return dayNameMap[locale][dayName][length] ?? dayName; 180 }, 181 182 outputViewersTimezone: function( target ) { 183 if( !target ) return; 184 185 let viewerTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone; 186 187 target.innerHTML = viewerTimezone; 188 } 189 } 190 191 window.piecalUtils = piecalUtils; 192})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.