Add editable weather captions and manage Threads scheduling with PM2
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { fromKstInput, kstFields } from '../../src/ui/time.ts';
|
||||
import { THREADS } from '../../src/constants/threads.ts';
|
||||
|
||||
export function nextRunAt(now: Date, completedDate?: string): Date {
|
||||
const date = kstFields(now).date;
|
||||
const today = fromKstInput(date, THREADS.scheduleHourKst * 60);
|
||||
if (completedDate === date) {
|
||||
const tomorrow = new Date(+fromKstInput(date, 12 * 60) + 86_400_000);
|
||||
return fromKstInput(kstFields(tomorrow).date, THREADS.scheduleHourKst * 60);
|
||||
}
|
||||
return +now < +today ? today : now;
|
||||
}
|
||||
Reference in New Issue
Block a user