mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-02 19:01:40 +00:00
restructure files onto electron-vite boilerplate
This commit is contained in:
parent
91ce2cd8a1
commit
1cf587bc8f
457 changed files with 9927 additions and 11705 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import type { Album, AlbumArtist, Song } from '/@/renderer/api/types';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import utc from 'dayjs/plugin/utc';
|
||||
import formatDuration from 'format-duration';
|
||||
import type { Album, AlbumArtist, Song } from '/@/renderer/api/types';
|
||||
|
||||
import { Rating } from '/@/renderer/components/rating';
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
|
|
@ -19,13 +21,13 @@ const getDateFormat = (key: string): string => {
|
|||
return FORMATS[dashes];
|
||||
};
|
||||
|
||||
export const formatDateAbsolute = (key: string | null) =>
|
||||
export const formatDateAbsolute = (key: null | string) =>
|
||||
key ? dayjs(key).format(getDateFormat(key)) : '';
|
||||
|
||||
export const formatDateAbsoluteUTC = (key: string | null) =>
|
||||
export const formatDateAbsoluteUTC = (key: null | string) =>
|
||||
key ? dayjs.utc(key).format(getDateFormat(key)) : '';
|
||||
|
||||
export const formatDateRelative = (key: string | null) => (key ? dayjs(key).fromNow() : '');
|
||||
export const formatDateRelative = (key: null | string) => (key ? dayjs(key).fromNow() : '');
|
||||
|
||||
export const formatDurationString = (duration: number) => {
|
||||
const rawDuration = formatDuration(duration).split(':');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue