Corrected received notification time formatting, changed a lv_label_set_text to lv_label_set_text_static
This commit is contained in:
parent
3c36ec92ad
commit
f31b3a2896
@ -324,7 +324,7 @@ void _display_message_notification(NotificationScreen_t * const notificationScre
|
||||
lv_obj_set_style_pad_right(notificationScreen->date_label, 10, LV_PART_MAIN);
|
||||
lv_obj_set_style_text_color(notificationScreen->date_label, lv_color_white(), LV_PART_MAIN);
|
||||
lv_obj_align(notificationScreen->date_label, LV_ALIGN_TOP_RIGHT, 0, 0);
|
||||
lv_label_set_text(notificationScreen->date_label, _notification_timestamp_to_date(notification->dateOfArrival));
|
||||
lv_label_set_text_static(notificationScreen->date_label, _notification_timestamp_to_date(notification->dateOfArrival));
|
||||
|
||||
//Create the sub-area in the notification
|
||||
lv_obj_t *sub_area = lv_obj_create(main_notification);
|
||||
@ -397,7 +397,7 @@ const char *_notification_timestamp_to_date(time_t timestamp)
|
||||
static char date[9]; //Ex 7:23PM
|
||||
|
||||
struct tm *time = gmtime(×tamp);
|
||||
sprintf(date, "%s%d:%s%d", time->tm_hour > 10 ? "" : "0", time->tm_hour, time->tm_min > 10 ? "" : "0", time->tm_min);
|
||||
sprintf(date, "%s%d:%s%d", time->tm_hour < 10 ? "0" : "", time->tm_hour, time->tm_min < 10 ? "0" : "", time->tm_min);
|
||||
return date;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user