Compare commits
3 Commits
dev
...
d5d2fa5836
| Author | SHA1 | Date | |
|---|---|---|---|
| d5d2fa5836 | |||
| ca102190ea | |||
| 8fee748837 |
@@ -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