Bumped birthday announcements to 2 weeks.

This commit is contained in:
Benjamin A. Shelton 2026-11-01 20:35:45 -07:00
commit a8d812495a
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
3 changed files with 4 additions and 6 deletions

View file

@ -105,7 +105,7 @@ func (a *App) daily() {
if time.Now().Format("Monday") == a.settings.Scheduler.Announcements.Weekly {
bdays, err := a.db.Birthdays().BirthdaysThisWeek(chat.ID)
if err == nil && len(bdays) > 0 {
sb.WriteString("**<u>Birthdays this week (Sunday-to-Sunday):</u>**\n\n")
sb.WriteString("**<u>Upcoming Birthdays (next 2 weeks):</u>**\n\n")
for _, bday := range bdays {
d, derr := time.Parse("2006-01-02", bday.Birthdate)
if derr == nil {

View file

@ -110,14 +110,12 @@ func (b *birthday) ListWeeklyBirthdays(ctx context.Context, cmd *cli.Command) er
}
return err
}
logger.Info("Upcoming Birthdays (next 2 weeks):")
logger.Info("=======================================")
if len(bdays) == 0 {
logger.Info("Birthdays this week (Sunday to Sunday):")
logger.Info("=======================================")
logger.Info(" (none)")
return nil
}
logger.Info("Birthdays this week (Sunday to Sunday):")
logger.Info("=======================================")
for _, bday := range bdays {
d, err := time.Parse("2006-01-02", bday.Birthdate)
if err != nil {

View file

@ -66,7 +66,7 @@ func (bm *BirthdayModel) BirthdaysThisWeek(chatid int64) ([]*Birthday, error) {
chatid = ? and
birthdate != date('now', 'localtime') and
(birthdate >= date('now', 'localtime', 'weekday 0') and
birthdate <= date('now', 'localtime', 'weekday 0', '+7 days')) order by birthdate asc;`
birthdate <= date('now', 'localtime', 'weekday 0', '+14 days')) order by birthdate asc;`
err := bm.db.SelectContext(bm.ctx, &bdays, q, chatid)
if err != nil {
var serr sqlite3.Error