@david551 The code needs to be changed to this
if (beg_today + 15768000 < t) {
/* More than 6 months from now - "April nineteenth two thousand three" */
res = ast_say_date_with_format_en(chan, t, ints, lang, "BdY", tzone);
} else if (beg_today + 2628000 < t)
{
/* Less than 6 months from now - "August seventh" */
res = ast_say_date_with_format_en(chan, t, ints, lang, "Bd", tzone);
}
else if (beg_today + 86400 * 6 < t)
{
/* Less than a month from now - "Sunday, October third" */
res = ast_say_date_with_format_en(chan, t, ints, lang, "ABd", tzone);
}
else if (beg_today + 172800 < t)
{
/* Within the next week */
res = ast_say_date_with_format_en(chan, t, ints, lang, "A", tzone);
}
else if (beg_today + 86400 < t)
{
/* Tomorrow */
res = wait_file(chan, ints, "digits/tomorrow", lang);
}
else if (beg_today < t)
{
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
}
else if (beg_today - 86400 < t)
{
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
}
else if (beg_today - 86400 * 6 < t)
{
/* Within the last week */
res = ast_say_date_with_format_en(chan, t, ints, lang, "A", tzone);
}
else if (beg_today - 2628000 < t)
{
/* Less than a month ago - "Sunday, October third" */
res = ast_say_date_with_format_en(chan, t, ints, lang, "ABd", tzone);
}
else if (beg_today - 15768000 < t)
{
/* Less than 6 months ago - "August seventh" */
res = ast_say_date_with_format_en(chan, t, ints, lang, "Bd", tzone);
}
else
{
/* More than 6 months ago - "April nineteenth two thousand three" */
res = ast_say_date_with_format_en(chan, t, ints, lang, "BdY", tzone);
}
Does it make sense?