Add day name to dgital watch face
authorNils Faerber <nils.faerber@kernelconcepts.de>
Sun, 5 May 2013 21:41:49 +0000 (23:41 +0200)
committerNils Faerber <nils.faerber@kernelconcepts.de>
Sun, 5 May 2013 21:41:49 +0000 (23:41 +0200)
ui/oswald_watch_faces.c

index 8be07ea..bfbf641 100644 (file)
@@ -206,6 +206,8 @@ void DrawLcdAnaClock(boolean show_seconds)
        hal_lcd_update_display();
 }
 
+static const char *daynames[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+
 void DrawLcdDigitalClock(boolean show_seconds)
 {
        int gRow = 1;
@@ -321,9 +323,9 @@ void DrawLcdDigitalClock(boolean show_seconds)
        }
 
        if (OswaldClk.day_first)
-               snprintf(tstr, 16, "%2d.%2d.%4d", OswaldClk.day, OswaldClk.month, OswaldClk.year);
+               snprintf(tstr, 16, "%s %d.%d.%d", daynames[OswaldClk.wday], OswaldClk.day, OswaldClk.month, OswaldClk.year);
        else
-               snprintf(tstr, 16, "%2d/%2d %4d", OswaldClk.month, OswaldClk.day, OswaldClk.year);
+               snprintf(tstr, 16, "%s %d/%d %d", daynames[OswaldClk.wday], OswaldClk.month, OswaldClk.day, OswaldClk.year);
        oswald_write_string(0, 25, FONT_6x9, tstr);
 
        gRow = 0;