1- import { DEFAULT_CONFIGURATION } from " ./constants" ;
2- import type { CollectionEntry } from " astro:content" ;
1+ import { DEFAULT_CONFIGURATION } from ' ./constants' ;
2+ import type { CollectionEntry } from ' astro:content' ;
33
44export const formatDate = ( date : Date ) => {
5- const formatter = new Intl . DateTimeFormat ( " en-US" , {
6- year : " numeric" ,
7- month : " short" ,
8- day : " numeric" ,
9- timeZone : " UTC" , // Default to UTC to prevent timezone issues
5+ const formatter = new Intl . DateTimeFormat ( ' en-US' , {
6+ year : ' numeric' ,
7+ month : ' short' ,
8+ day : ' numeric' ,
9+ timeZone : ' UTC' , // Default to UTC to prevent timezone issues
1010 } ) ;
1111
1212 // Ensure we're parsing the date correctly
@@ -16,17 +16,17 @@ export const formatDate = (date: Date) => {
1616export const generateAbsoluteUrl = ( path : string ) =>
1717 DEFAULT_CONFIGURATION . baseUrl . concat ( path ) ;
1818
19- export const isDevelopment = ( ) => import . meta. env . MODE === " development" ;
19+ export const isDevelopment = ( ) => import . meta. env . MODE === ' development' ;
2020
2121export const includeDraft = ( draft : boolean ) => {
2222 if ( isDevelopment ( ) ) return true ;
2323 return draft !== true ;
2424} ;
2525
26- export const sortJobsByDate = ( jobs : CollectionEntry < " jobs" > [ ] ) => {
26+ export const sortJobsByDate = ( jobs : CollectionEntry < ' jobs' > [ ] ) => {
2727 // Convert "Now" to current year, otherwise returns the year as is
28- const getEndYear = ( job : CollectionEntry < " jobs" > ) =>
29- job . data . to === " Now" ? new Date ( ) . getFullYear ( ) : job . data . to ;
28+ const getEndYear = ( job : CollectionEntry < ' jobs' > ) =>
29+ job . data . to === ' Now' ? new Date ( ) . getFullYear ( ) : job . data . to ;
3030
3131 return jobs . sort ( ( current , next ) => {
3232 // Compare end years first, then fall back to start years if end years are equal
0 commit comments