5 Commits

Author SHA1 Message Date
8e47a3bc8a Version Bump: v0.1.6 2025-11-07 00:42:52 +00:00
eb0c5e1580 Removed Parameter --today from docker-entrypoint.sh
dont query todays Events and send a Notification if the Container starts the first time.
2025-11-07 00:42:32 +00:00
d5d2fa5836 Bugfix "Not sending 'Todays Events'"
Format Month and Day with a Leading 0 for values between 1 to 9 when querying the DB for Todays Events only.
2025-11-07 00:27:45 +00:00
ca102190ea Changed: only get Events from the Db which are not marked as deleted, indicated by having a value for "deleteDate" 2025-11-07 00:25:15 +00:00
8fee748837 Added "hour" to getTsNow() 2025-11-07 00:24:03 +00:00
6 changed files with 8 additions and 7 deletions

View File

@@ -1,6 +1,6 @@
services: services:
app: app:
image: chiko/77th_eventcalendarntfy:v0.1.5 image: chiko/77th_eventcalendarntfy:v0.1.6
build: . build: .
volumes: volumes:
- ./data/db:/opt/app/data/db - ./data/db:/opt/app/data/db

View File

@@ -35,7 +35,7 @@ for var in "${env_vars[@]}"; do
done done
export PATH="/root/.bun/bin:$PATH" export PATH="/root/.bun/bin:$PATH"
bun run /opt/app/src/app.ts --today bun run /opt/app/src/app.ts
# Start cron in foreground # Start cron in foreground
exec cron -f exec cron -f

View File

@@ -1,5 +1,5 @@
{ {
"version": "0.1.5", "version": "0.1.6",
"name": "77th_eventcalendarnotification", "name": "77th_eventcalendarnotification",
"module": "./src/app.ts", "module": "./src/app.ts",
"type": "module", "type": "module",

View File

@@ -21,8 +21,8 @@ async function events_update_db() {
const events_fetched_list_of_uids = events_fetched.map( event => { return event.uid; }); const events_fetched_list_of_uids = events_fetched.map( event => { return event.uid; });
console.dir( {events_fetched_list_of_uids} ); console.dir( {events_fetched_list_of_uids} );
const events_db_currentMonth = Event.get_events({month: {year: TODAY.year, month: TODAY.month}}, db); const events_db_currentMonth = Event.get_events({month: {year: TODAY.year, month: TODAY.month}, deleted: false}, db);
const events_db_nextMonth = Event.get_events({month: {year: TODAY.year, month: (TODAY.month + 1)}}, db); const events_db_nextMonth = Event.get_events({month: {year: TODAY.year, month: (TODAY.month + 1)}, deleted: false}, db);
const events_db = [... events_db_currentMonth, ... events_db_nextMonth]; const events_db = [... events_db_currentMonth, ... events_db_nextMonth];
const events_removed: Event[] = events_db.filter( (ev) => { const events_removed: Event[] = events_db.filter( (ev) => {
return ! events_fetched_list_of_uids.includes(ev.uid); return ! events_fetched_list_of_uids.includes(ev.uid);

View File

@@ -95,10 +95,10 @@ export class Event implements TEventEntity {
whereConditions.push( `notification IN ('${ options.notification.join("', '") }')` ) whereConditions.push( `notification IN ('${ options.notification.join("', '") }')` )
} }
if ( options.date ) { if ( options.date ) {
whereConditions.push(`date_at = "${options.date.year}-${options.date.month}-${options.date.day}"`); whereConditions.push(`date_at = "${options.date.year}-${pad_l2(options.date.month)}-${pad_l2(options.date.day)}"`);
} }
if ( options.month ) { if ( options.month ) {
whereConditions.push( `strftime('%Y-%m', date_at) = '${options.month.year}-${options.month.month}'`) whereConditions.push( `strftime('%Y-%m', date_at) = '${options.month.year}-${pad_l2(options.month.month)}'`)
} }
const where = ( () => { const where = ( () => {

View File

@@ -34,6 +34,7 @@ export function getTsNow() {
year: now.getFullYear(), year: now.getFullYear(),
month: now.getMonth() + 1, month: now.getMonth() + 1,
day: now.getDate(), day: now.getDate(),
hour: now.getHours(),
minute: now.getMinutes(), minute: now.getMinutes(),
seconds: now.getSeconds() seconds: now.getSeconds()
} }