diff --git a/.gitignore b/.gitignore index df47c8cd..4cc94190 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ build .cache application/assets/js/google_cred.js application/google_cred.js +.env diff --git a/application/app.js b/application/app.js index 213f32e4..083f5683 100644 --- a/application/app.js +++ b/application/app.js @@ -401,7 +401,6 @@ async function load_caldav(callback = false) { if (callback) side_toaster('all event reloaded', 2000); } closing_prohibited = false; - // style_calendar_cell(currentYear, currentMonth); side_toaster('Data loaded', 3000); } catch (e) { if (m.route.get() === '/page_calendar') { @@ -1682,6 +1681,11 @@ var page_events = { se = formatDT(item.DTSTART._time).format('HH:mm'); } + let weekDay = + settings.firstday == 'sunday' + ? weekday[dayjs(formatDT(item.DTSTART._time)).day()] + : weekday[dayjs(formatDT(item.DTSTART._time)).day() - 1]; + //date if ( item.DTSTART != null && @@ -1698,7 +1702,7 @@ var page_events = { de = formatDT(item.DTSTART._time).format(settings.dateformat) + ' | ' + - weekday[dayjs(formatDT(item.DTSTART._time)).day()]; + weekDay; } let u = item.isSubscription ? 'subscription' : ''; @@ -2054,6 +2058,48 @@ export let page_options = { ), ] ), + m( + 'div', + { + class: 'item input-parent', + id: 'event-duration-wrapper', + tabindex: '5', + }, + [ + m('label', { for: 'default-duration-time' }, 'default Duration'), + m( + 'select', + { + id: 'default-duration-time', + class: 'select-box', + onchange: function () { + store_settings(); + }, + oncreate: function () { + load_settings(); + setTimeout(function () { + focus_after_selection(); + if (settings.default_duration == '') { + document.querySelector('#default-duration-time').value = + 'none'; + } else { + document.querySelector( + '#default-notification-time' + ).value = settings.default_duration; + } + }, 1000); + }, + }, + [ + m('option', { value: 'none' }, 'none'), + m('option', { value: '30' }, '30 minutes'), + m('option', { value: '60' }, '60 minutes'), + m('option', { value: '120' }, '120 minutes'), + m('option', { value: '240' }, '240 minutes'), + ] + ), + ] + ), m( 'div', @@ -2899,7 +2945,14 @@ var page_add_event = { }, oncreate: function ({ dom }) { - dom.value = dayjs().add(1, 'hour').format('HH:mm'); + console.log(settings.default_duration); + if (settings.default_duration != '') { + dom.value = dayjs() + .add(settings.default_duration, 'minutes') + .format('HH:mm'); + } else { + dom.value = dayjs().add(1, 'hour').format('HH:mm'); + } }, }), ]), @@ -3514,6 +3567,10 @@ let store_settings = function () { 'default-notification-time' ).value; + settings.default_duration = document.getElementById( + 'default-duration-time' + ).value; + settings.dateformat = document.getElementById('event-date-format').value; settings.firstday = document.getElementById('first-day-of-the-week').value; settings.eventsfilter = document.getElementById( @@ -5050,9 +5107,6 @@ function handleKeyDown(evt) { function handleKeyUp(evt) { if (status.visible === false) return false; - if (evt.key == 'Backspace' && document.activeElement.tagName == 'INPUT') { - } - clearTimeout(timeout); if (!longpress) { shortpress_action(evt); @@ -5072,7 +5126,7 @@ if (debug) { } // Set up a timer to check if no messages have arrived for a certain period -const waitTimeout = 500; // Time in milliseconds +const waitTimeout = 400; // Time in milliseconds const checkMessagesInterval = 100; // Interval to check for new messages let waitForNoMessages; let interval_is_running = false; diff --git a/application/manifest.webapp b/application/manifest.webapp index 9ea14c4b..fd57df72 100644 --- a/application/manifest.webapp +++ b/application/manifest.webapp @@ -1,5 +1,5 @@ { - "version": "2.2.609", + "version": "2.2.611", "name": "greg", "id": "greg", "categories": ["utilities"],