File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
ADMIN_SECRET = rDKs0Drx6Rmnqz09s1pDBYOvszpOkuPR
2
2
FALLBACK_URL = http://isittuesday.co.uk/
3
+ TIMEZONE = America/New_York
3
4
4
5
SOURCE = google-sheets
5
6
GOOGLE_SHEET_DOC_ID = 06d8f872-6083-44c3-92a0-fbd82565f98f
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export interface AirtableConfig {
23
23
interface Config extends CleanedEnvAccessors {
24
24
adminSecret : string ;
25
25
fallbackUrl : string ;
26
+ timezone : string ;
26
27
redisUrl ?: string ;
27
28
source : LinkSourceType ;
28
29
googleConfig ?: GoogleConfig ;
@@ -44,6 +45,7 @@ const env = cleanEnv(process.env, {
44
45
ADMIN_SECRET : str ( { } ) ,
45
46
FALLBACK_URL : url ( { } ) ,
46
47
FLY_REDIS_CACHE_URL : str ( { default : undefined } ) ,
48
+ TIMEZONE : str ( { } ) ,
47
49
SOURCE : linkSource ( {
48
50
choices : Object . values ( LinkSourceType ) ,
49
51
default : LinkSourceType . GoogleSheets ,
@@ -88,6 +90,7 @@ export const config: Config = {
88
90
...envConfig ,
89
91
adminSecret : env . ADMIN_SECRET ,
90
92
fallbackUrl : env . FALLBACK_URL ,
93
+ timezone : env . TIMEZONE ,
91
94
redisUrl : env . FLY_REDIS_CACHE_URL ,
92
95
source : env . SOURCE ,
93
96
googleConfig,
Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ import request from 'superagent';
5
5
6
6
import { Cache } from './cache' ;
7
7
import { LinkRecord , LinkSource } from './types' ;
8
+ import { config } from '../config' ;
8
9
9
- const currentYYMMDD = ( ) => DateTime . now ( ) . toFormat ( 'yyMMdd' ) ;
10
+ const currentYYMMDD = ( ) => DateTime . now ( ) . setZone ( config . timezone ) . toFormat ( 'yyMMdd' ) ;
10
11
11
12
export interface LookupPathOptions {
12
13
exactMatch : ( matchingEntry : string ) => void ;
You can’t perform that action at this time.
0 commit comments