diff --git a/components/Navbar.tsx b/components/Navbar.tsx index c74d034..4c9ecce 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -24,7 +24,10 @@ const Navbar = () => { const [searchOpen, setSearchOpen] = useState(false) const openSearchBox = () => setSearchOpen(true) - useHotkeys(`${os === 'mac' ? 'cmd' : 'ctrl'}+k`, openSearchBox) + useHotkeys(`${os === 'mac' ? 'cmd' : 'ctrl'}+k`, e => { + openSearchBox() + e.preventDefault() + }) useEffect(() => { const storedToken = () => { diff --git a/components/previews/AudioPreview.tsx b/components/previews/AudioPreview.tsx index 1e9c020..c76962a 100644 --- a/components/previews/AudioPreview.tsx +++ b/components/previews/AudioPreview.tsx @@ -8,6 +8,7 @@ import { useTranslation } from 'next-i18next' import DownloadButtonGroup from '../DownloadBtnGtoup' import { DownloadBtnContainer, PreviewContainer } from './Containers' import { LoadingIcon } from '../Loading' +import { formatModifiedDateTime } from '../../utils/fileDetails' enum PlayerState { Loading, @@ -39,11 +40,7 @@ const AudioPreview: FC<{ file: OdFileObject }> = ({ file }) => {
{file.name}
- {t('Last modified:') + ' '} - {new Date(file.lastModifiedDateTime).toLocaleString(undefined, { - dateStyle: 'short', - timeStyle: 'short', - })} + {t('Last modified:') + ' ' + formatModifiedDateTime(file.lastModifiedDateTime)}
{ * @returns Human readable form of the file or folder last modified date */ export const formatModifiedDateTime = (lastModifedDateTime: string) => { - return new Date(lastModifedDateTime).toLocaleString('en-US', { - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - hour12: false, - }) + return dayjs(lastModifedDateTime).format(siteConfig.datetimeFormat) }