Compare commits
12 Commits
2f805c0772
...
version/0.
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e47a3bc8a | |||
| eb0c5e1580 | |||
| d5d2fa5836 | |||
| ca102190ea | |||
| 8fee748837 | |||
| c6ec442c2b | |||
| 3e5032caf3 | |||
| 8aef42396e | |||
| 170695f9ff | |||
| a37d95709f | |||
| 152c1bcba0 | |||
| ae569b7739 |
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
app:
|
||||
image: chiko/77th_eventcalendarntfy:v0.1.4
|
||||
image: chiko/77th_eventcalendarntfy:v0.1.6
|
||||
build: .
|
||||
volumes:
|
||||
- ./data/db:/opt/app/data/db
|
||||
|
||||
@@ -35,7 +35,7 @@ for var in "${env_vars[@]}"; do
|
||||
done
|
||||
|
||||
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
|
||||
exec cron -f
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "0.1.4",
|
||||
"version": "0.1.6",
|
||||
"name": "77th_eventcalendarnotification",
|
||||
"module": "./src/app.ts",
|
||||
"type": "module",
|
||||
|
||||
@@ -21,8 +21,8 @@ async function events_update_db() {
|
||||
const events_fetched_list_of_uids = events_fetched.map( event => { return event.uid; });
|
||||
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_nextMonth = Event.get_events({month: {year: TODAY.year, month: (TODAY.month + 1)}}, 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)}, deleted: false}, db);
|
||||
const events_db = [... events_db_currentMonth, ... events_db_nextMonth];
|
||||
const events_removed: Event[] = events_db.filter( (ev) => {
|
||||
return ! events_fetched_list_of_uids.includes(ev.uid);
|
||||
|
||||
@@ -95,10 +95,10 @@ export class Event implements TEventEntity {
|
||||
whereConditions.push( `notification IN ('${ options.notification.join("', '") }')` )
|
||||
}
|
||||
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 ) {
|
||||
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 = ( () => {
|
||||
|
||||
@@ -34,6 +34,7 @@ export function getTsNow() {
|
||||
year: now.getFullYear(),
|
||||
month: now.getMonth() + 1,
|
||||
day: now.getDate(),
|
||||
hour: now.getHours(),
|
||||
minute: now.getMinutes(),
|
||||
seconds: now.getSeconds()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user