(img: RcFile, callback: (url: string) => void)
| 13 | } |
| 14 | |
| 15 | export const getImgBase64 = (img: RcFile, callback: (url: string) => void) => { |
| 16 | const reader = new FileReader() |
| 17 | reader.addEventListener('load', () => callback(reader.result as string)) |
| 18 | reader.readAsDataURL(img) |
| 19 | } |
| 20 | |
| 21 | export const frontendTimeSorter = (a: { [k: string]: string }, b: { [k: string]: string }, field: string) => { |
| 22 | return new Date(a[field]).getTime() - new Date(b[field]).getTime() |