Datetime date initial value fix (#6483)

This commit is contained in:
RFDarter authored and GitHub committed 2024-04-08 19:36:23 +12:00
1 parent 6f71363d9b
commit d6352b3be4
2 files changed
+11 -2

No files matched your search

+1 -1
View File
@@ -914,7 +914,7 @@ void WebServer::handle_date_request(AsyncWebServerRequest *request, const UrlMat
std::string WebServer::date_json(datetime::DateEntity *obj, JsonDetail start_config) {
return json::build_json([obj, start_config](JsonObject root) {
set_json_id(root, obj, "date-" + obj->get_object_id(), start_config);
std::string value = str_sprintf("%d-%d-%d", obj->year, obj->month, obj->day);
std::string value = str_sprintf("%d-%02d-%02d", obj->year, obj->month, obj->day);
root["value"] = value;
root["state"] = value;
});