2023-05-04 06:45:28 +00:00
|
|
|
import { differenceInYears } from 'date-fns';
|
|
|
|
|
2022-10-16 10:13:09 +00:00
|
|
|
export function getSlugFromFile(file: string): string {
|
|
|
|
const parts = file.replace('.md', '').split('/')
|
|
|
|
|
|
|
|
return parts[parts.length - 1]
|
|
|
|
}
|
2023-05-04 06:45:28 +00:00
|
|
|
|
|
|
|
export const numberOfYears = differenceInYears(new Date(), new Date(2007, 0, 1));
|