mirror of
https://github.com/infinilabs/coco-app.git
synced 2026-02-24 04:01:27 +01:00
refactor: format Coco server update time in settings (#1040)
Previously, the last update time of the Coco server in the "Connect" settings page was displayed using the raw string directly from the `updated` field, which lacked consistent formatting. This commit refactors the `ServiceMetadata` component to use the `formatDateToLocal` utility function. This ensures the update time is displayed in a standardized `YYYY/MM/DD HH:mm:ss` format and provides a fallback value if the date is invalid or missing.
This commit is contained in:
@@ -27,6 +27,7 @@ Information about release notes of Coco App is provided here.
|
||||
### ✈️ Improvements
|
||||
|
||||
- refactor: add a timeout to open() #1025
|
||||
- refactor: format Coco server update time in settings #1040
|
||||
|
||||
## 0.10.0 (2025-12-19)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import { memo } from "react";
|
||||
import { PackageOpen, GitFork, CalendarSync } from "lucide-react";
|
||||
|
||||
import { useConnectStore } from "@/stores/connectStore";
|
||||
import { formatDateToLocal } from "@/utils/date";
|
||||
|
||||
interface ServiceMetadataProps {}
|
||||
|
||||
@@ -20,7 +21,7 @@ const ServiceMetadata = memo(({}: ServiceMetadataProps) => {
|
||||
</span>
|
||||
<span className="mx-4">|</span>
|
||||
<span className="flex items-center gap-1">
|
||||
<CalendarSync className="w-4 h-4" /> {cloudSelectService?.updated}
|
||||
<CalendarSync className="w-4 h-4" /> {formatDateToLocal(cloudSelectService?.updated)}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-gray-600 dark:text-gray-300 leading-relaxed">
|
||||
|
||||
Reference in New Issue
Block a user