File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 1
1
export type PostMetadata = {
2
- title : string
3
- description : string
4
- posted : Date
5
- tags : string [ ]
6
- slug ? : string
2
+ title ? : string
3
+ description ? : string
4
+ date ?: string
5
+ tags ? : string [ ]
6
+ slug : string
7
7
}
8
8
9
9
export type PostData = {
Original file line number Diff line number Diff line change @@ -5,10 +5,17 @@ export function cn(...inputs: ClassValue[]) {
5
5
return twMerge ( clsx ( inputs ) ) ;
6
6
}
7
7
8
- export const formattedDate = ( d : Date ) : string => {
8
+ export const formatDate = ( d : Date ) : string => {
9
9
return new Intl . DateTimeFormat ( 'en-US' , {
10
10
month : 'short' ,
11
11
day : '2-digit' ,
12
12
year : 'numeric'
13
13
} ) . format ( d ) ;
14
14
} ;
15
+
16
+ export const formatShortDate = ( d : Date ) : string => {
17
+ return new Intl . DateTimeFormat ( 'en-US' , {
18
+ month : 'long' ,
19
+ day : '2-digit' ,
20
+ } ) . format ( d ) ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments