mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
formatting
This commit is contained in:
@@ -1 +1,2 @@
|
||||
export const routeMatches = (route: string, pathname: string) => pathname.startsWith(route + '/') || pathname === route;
|
||||
export const routeMatches = (route: string, pathname: string) =>
|
||||
pathname.startsWith(route + '/') || pathname === route;
|
||||
|
||||
@@ -8,7 +8,11 @@ const LOCALE_FORMAT = new Intl.DateTimeFormat([...window.navigator.languages], {
|
||||
hour12: false
|
||||
});
|
||||
|
||||
export const formatDateTime = (dateTime: string) => LOCALE_FORMAT.format(new Date(dateTime.substring(0, 19)));
|
||||
export const formatDateTime = (dateTime: string) =>
|
||||
LOCALE_FORMAT.format(new Date(dateTime.substring(0, 19)));
|
||||
|
||||
export const formatLocalDateTime = (date: Date) =>
|
||||
new Date(date.getTime() - date.getTimezoneOffset() * 60000).toISOString().slice(0, -1).substring(0, 19);
|
||||
new Date(date.getTime() - date.getTimezoneOffset() * 60000)
|
||||
.toISOString()
|
||||
.slice(0, -1)
|
||||
.substring(0, 19);
|
||||
|
||||
@@ -22,7 +22,12 @@ export const useRest = <D>({ read, update }: RestRequestOptions<D>) => {
|
||||
const [dirtyFlags, setDirtyFlags] = useState<string[]>([]);
|
||||
const blocker = useBlocker(dirtyFlags.length !== 0);
|
||||
|
||||
const { data, send: readData, update: updateData, onComplete: onReadComplete } = useRequest(read());
|
||||
const {
|
||||
data,
|
||||
send: readData,
|
||||
update: updateData,
|
||||
onComplete: onReadComplete
|
||||
} = useRequest(read());
|
||||
|
||||
const {
|
||||
loading: saving,
|
||||
|
||||
Reference in New Issue
Block a user