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' ;
3
3
4
4
export 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
10
10
} ) ;
11
11
12
12
// Ensure we're parsing the date correctly
@@ -16,17 +16,17 @@ export const formatDate = (date: Date) => {
16
16
export const generateAbsoluteUrl = ( path : string ) =>
17
17
DEFAULT_CONFIGURATION . baseUrl . concat ( path ) ;
18
18
19
- export const isDevelopment = ( ) => import . meta. env . MODE === " development" ;
19
+ export const isDevelopment = ( ) => import . meta. env . MODE === ' development' ;
20
20
21
21
export const includeDraft = ( draft : boolean ) => {
22
22
if ( isDevelopment ( ) ) return true ;
23
23
return draft !== true ;
24
24
} ;
25
25
26
- export const sortJobsByDate = ( jobs : CollectionEntry < " jobs" > [ ] ) => {
26
+ export const sortJobsByDate = ( jobs : CollectionEntry < ' jobs' > [ ] ) => {
27
27
// 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 ;
30
30
31
31
return jobs . sort ( ( current , next ) => {
32
32
// Compare end years first, then fall back to start years if end years are equal
0 commit comments