]> git.sur5r.net Git - i3/i3status/commitdiff
Teen ordinal numbers always use a 'th' suffix.
authorDeiz <silverwraithii@gmail.com>
Wed, 31 Oct 2012 17:27:41 +0000 (13:27 -0400)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 5 Nov 2012 23:26:47 +0000 (00:26 +0100)
src/print_ddate.c

index 6d39c51479aa0c237586677098fa5889f1ee0e1c..82138620ddb4d7b4774d588b9ac1eb6413011cc4 100644 (file)
@@ -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");