Skip to content

Commit 2f50c2c

Browse files
committed
fix: remove console log
1 parent e77d2a8 commit 2f50c2c

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

packages/backend/src/apps/formatter/actions/date-time/common/date-time-format.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ export function parseDateTime(
134134
): DateTime {
135135
const result = formatConverters[dateTimeFormat].parse(valueToTransform)
136136

137-
if (dateTimeFormat === 'dd LLL yyyy' && !result.isValid) {
138-
result = formatConverters[dateTimeFormat].parse(valueToTransform, {
139-
locale: 'en-US',
140-
})
141-
}
142-
143137
if (!result.isValid) {
144138
throw new Error(
145139
`${valueToTransform}' is not a valid ${formatConverters[dateTimeFormat].description}`,

packages/backend/src/apps/formatter/actions/date-time/transforms/convert-date-time/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ export const spec = {
5656
},
5757
})
5858
} catch (error) {
59-
console.log('error', error)
6059
if (error instanceof StepError) {
6160
throw error
6261
}

packages/backend/src/apps/lettersg/actions/create-letter/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const responseSchema = z
6767
// Have to set to en-US to process the month "Sep" while en-SG only accepts "Sept"
6868
createdAt: DateTime.fromFormat(data.createdAt, 'EEE MMM dd yyyy', {
6969
locale: 'en-US',
70-
}).toFormat(
70+
}).toPlumberFormat(
7171
'dd MMM yyyy', // format a time usable for other steps
7272
),
7373
}))

packages/backend/src/types/luxon-extensions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { DateTime, LocaleOptions } from 'luxon'
33
declare module 'luxon' {
44
interface DateTime {
55
toPlumberFormat(fmt: string, opts?: LocaleOptions): string
6+
/**
7+
* @deprecated
8+
* Use toPlumberFormat instead.
9+
*/
10+
toFormat(fmt: string, opts?: LocaleOptions): string
611
}
712
}
813

0 commit comments

Comments
 (0)