summaryrefslogtreecommitdiff
path: root/src/print_ddate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/print_ddate.c')
-rw-r--r--src/print_ddate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/print_ddate.c b/src/print_ddate.c
index 6d39c51..8213862 100644
--- a/src/print_ddate.c
+++ b/src/print_ddate.c
@@ -95,6 +95,11 @@ static int format_output(char *outwalk, char *format, struct disc_time *dt) {
break;
case 'e':
outwalk += sprintf(outwalk, "%d", dt->season_day + 1);
+ if (dt->season_day > 9 && dt->season_day < 13) {
+ outwalk += sprintf(outwalk, "th");
+ break;
+ }
+
switch (dt->season_day % 10) {
case 0:
outwalk += sprintf(outwalk, "st");