(calendarData)
| 1300 | FUNCTION calendarText |
| 1301 | ------------------------------------------------------------------*/ |
| 1302 | function calendarText(calendarData) { |
| 1303 | const events = calendarData.pEventsTodayCount + calendarData.wEventsTodayCount; |
| 1304 | const allDayEvents = calendarData.pEventsTodayAllDayCount + calendarData.wEventsTodayAllDayCount; |
| 1305 | if (events == 0 && allDayEvents == 0){ |
| 1306 | text = `Your day is clear.`; |
| 1307 | } else if (events == 0 && allDayEvents > 0) { |
| 1308 | text = `You've got ${allDayEvents} all day event(s) today.`; |
| 1309 | } else if (events > 0 && allDayEvents == 0) { |
| 1310 | text = `You've got ${events} event(s) today.`; |
| 1311 | } else { |
| 1312 | text = `You've got ${events} event(s) and ${allDayEvents} all day event(s) today.`; |
| 1313 | } |
| 1314 | let wrapText = (s, w) => s.replace( |
| 1315 | new RegExp(`(?![^\\n]{1,${w}}$)([^\\n]{1,${w}})\\s`, 'g'), '$1\n' |
| 1316 | ); |
| 1317 | const text0 = wrapText(text,50); |
| 1318 | return text0; |
| 1319 | } |
| 1320 | /*------------------------------------------------------------------ |
| 1321 | FUNCTION checkUpdates |
| 1322 | ------------------------------------------------------------------*/ |
nothing calls this directly
no test coverage detected