mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-04 02:05:21 +03:00
Add docs with examples
This commit is contained in:
parent
7dbca95a9a
commit
1fc2927805
@ -477,18 +477,6 @@ cameras:
|
|||||||
order: 0
|
order: 0
|
||||||
# Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
|
# Optional: Whether or not to show the camera in the Frigate UI (default: shown below)
|
||||||
dashboard: True
|
dashboard: True
|
||||||
# Optional: Override browser locale and show time in 12 / 24 hour format (default: use browser locale)
|
|
||||||
use12hour: False
|
|
||||||
# Optional: Set the date style for a specified length.
|
|
||||||
# Options are: full, long, medium, sort (default: shown below).
|
|
||||||
date_style: short
|
|
||||||
# Optional: Set the time style for a specified length.
|
|
||||||
# Options are: full, long, medium, sort (default: shown below).
|
|
||||||
time_style: medium
|
|
||||||
# Optional: Ability to manually override the date / time styling to use strftime format
|
|
||||||
# https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
|
|
||||||
# possible values are shown above (default: not set)
|
|
||||||
strftime_fmt: "%Y/%m/%d %H:%M"
|
|
||||||
|
|
||||||
# Optional
|
# Optional
|
||||||
ui:
|
ui:
|
||||||
@ -498,6 +486,29 @@ ui:
|
|||||||
timezone: None
|
timezone: None
|
||||||
# Optional: Use an experimental recordings / camera view UI (default: shown below)
|
# Optional: Use an experimental recordings / camera view UI (default: shown below)
|
||||||
experimental_ui: False
|
experimental_ui: False
|
||||||
|
# Optional: Set the time format used.
|
||||||
|
# Options are browser, hour12, or hour24 (default: shown below)
|
||||||
|
time-format: browser
|
||||||
|
# Optional: Set the date style for a specified length.
|
||||||
|
# Options are: full, long, medium, sort
|
||||||
|
# Examples:
|
||||||
|
# short: 2/11/23
|
||||||
|
# medium: Feb 11, 2023
|
||||||
|
# full: Saturday, February 11, 2023
|
||||||
|
# (default: shown below).
|
||||||
|
date_style: short
|
||||||
|
# Optional: Set the time style for a specified length.
|
||||||
|
# Options are: full, long, medium, sort
|
||||||
|
# Examples:
|
||||||
|
# short: 8:14 PM
|
||||||
|
# medium: 8:15:22 PM
|
||||||
|
# full: 8:15:22 PM Mountain Standard Time
|
||||||
|
# (default: shown below).
|
||||||
|
time_style: medium
|
||||||
|
# Optional: Ability to manually override the date / time styling to use strftime format
|
||||||
|
# https://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html
|
||||||
|
# possible values are shown above (default: not set)
|
||||||
|
strftime_fmt: "%Y/%m/%d %H:%M"
|
||||||
|
|
||||||
# Optional: Telemetry configuration
|
# Optional: Telemetry configuration
|
||||||
telemetry:
|
telemetry:
|
||||||
|
|||||||
@ -45,11 +45,12 @@ interface DateTimeStyle {
|
|||||||
|
|
||||||
export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: DateTimeStyle): string => {
|
export const formatUnixTimestampToDateTime = (unixTimestamp: number, config: DateTimeStyle): string => {
|
||||||
const { timezone, time_format, date_style, time_style, strftime_fmt } = config;
|
const { timezone, time_format, date_style, time_style, strftime_fmt } = config;
|
||||||
const locale = window.navigator?.language || 'en-US';
|
const locale = window.navigator?.language || 'en-us';
|
||||||
|
|
||||||
if (isNaN(unixTimestamp)) {
|
if (isNaN(unixTimestamp)) {
|
||||||
return 'Invalid time';
|
return 'Invalid time';
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const date = new Date(unixTimestamp * 1000);
|
const date = new Date(unixTimestamp * 1000);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user