timetable-app

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

formatDate.ts (354B)


      1 import { format } from 'date-fns';
      2 import { ja } from 'date-fns/locale';
      3 
      4 import { DATE_FORMAT } from 'common/constant';
      5 
      6 const formatDate = (
      7 	date: Parameters<typeof format>[0],
      8 	formatStr: string = DATE_FORMAT,
      9 	options?: Parameters<typeof format>[2],
     10 ) => {
     11 	return format(date, formatStr, { locale: ja, ...options });
     12 };
     13 
     14 export default formatDate;