diff --git a/server/fetch-events-for-timestamp.js b/server/fetch-events-for-timestamp.js index d5d4d38..c87d5f8 100644 --- a/server/fetch-events-for-timestamp.js +++ b/server/fetch-events-for-timestamp.js @@ -14,11 +14,12 @@ async function fetchEventsForTimestamp(roomId, ts) { const timestampToEventEndpoint = urlJoin( matrixServerUrl, - `_matrix/client/unstable/org.matrix.msc3030/rooms/${roomId}/timestamp_to_event?ts=${ts}&dir=f` + `_matrix/client/unstable/org.matrix.msc3030/rooms/${roomId}/timestamp_to_event?ts=${ts}&dir=b` ); const timestampToEventResData = await fetchEndpoint(timestampToEventEndpoint); const eventIdForTimestamp = timestampToEventResData.event_id; assert(eventIdForTimestamp); + console.log('eventIdForTimestamp', eventIdForTimestamp); const contextEndpoint = urlJoin( matrixServerUrl, diff --git a/shared/CalendarView.js b/shared/CalendarView.js index 6ab37fb..5f0620a 100644 --- a/shared/CalendarView.js +++ b/shared/CalendarView.js @@ -89,7 +89,11 @@ class CalendarView extends TemplateView { t.input({ type: 'month', className: { CalendarView_heading_monthInput: true }, - value: `${calendarDate.getUTCFullYear()}-${calendarDate.getUTCMonth() + 1}`, + value: `${calendarDate.getUTCFullYear()}-${ + // ('0' + '2') -> '02' + // ('0' + '12') -> '12' + ('0' + (calendarDate.getUTCMonth() + 1)).slice(-2) + }`, onChange: (e) => vm.onMonthInputChange(e), }), @@ -156,10 +160,6 @@ class CalendarView extends TemplateView { // day number from 0 (monday) to 6 (sunday) const dayNumber = dayNumberDate.getUTCDay(); - console.log( - `dayNumberDate=${dayNumberDate.getUTCDate()} (${dayNumber}) isDayInFuture=${isDayInFuture}, ${dayNumberDate.getTime()}, ${todayTs}` - ); - // +1 because we're going from 0-based day to 1-based `grid-column-start` const gridColumnStart = dayNumber + 1;