mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-16 07:08:48 +01:00
22 lines
670 B
React
22 lines
670 B
React
|
|
import { SelectInput, useTranslate } from 'react-admin'
|
||
|
|
import { getStoredDateFormat } from '../i18n/useDateLocale'
|
||
|
|
|
||
|
|
export const SelectDateFormat = (props) => {
|
||
|
|
const translate = useTranslate()
|
||
|
|
|
||
|
|
return (
|
||
|
|
<SelectInput
|
||
|
|
{...props}
|
||
|
|
source="dateFormat"
|
||
|
|
label={translate('menu.personal.options.dateFormat')}
|
||
|
|
defaultValue={getStoredDateFormat()}
|
||
|
|
choices={[
|
||
|
|
{ id: 'language', name: 'menu.personal.options.dateFormats.language' },
|
||
|
|
{ id: 'browser', name: 'menu.personal.options.dateFormats.browser' },
|
||
|
|
]}
|
||
|
|
onChange={(event) => {
|
||
|
|
localStorage.setItem('dateFormat', event.target.value)
|
||
|
|
}}
|
||
|
|
/>
|
||
|
|
)
|
||
|
|
}
|