Skip to content

🎥 Make videos programmatically with React

extract datestring

Jonny Burgera7643d2c0bf1
diff --git a/packages/lambda/src/cli/commands/sites/ls.ts b/packages/lambda/src/cli/commands/sites/ls.ts
index a89694778f..fffa085d73 100644
--- a/packages/lambda/src/cli/commands/sites/ls.ts
+++ b/packages/lambda/src/cli/commands/sites/ls.ts
@@ -3,18 +3,11 @@ import {Log} from '@remotion/cli/dist/log';
import {getSites} from '../../../api/get-sites';
import {makeS3Url} from '../../../shared/make-s3-url';
import {getAwsRegion} from '../../get-aws-region';
+import {dateString} from '../../helpers/date-string';
import {formatBytes} from '../../helpers/format-bytes';
export const SITES_LS_SUBCOMMAND = 'ls';
-// TODO: extract
-const dateString = (date: Date) =>
- date.getFullYear() +
- '-' +
- String(date.getMonth() + 1).padEnd(2, '0') +
- '-' +
- String(date.getDate()).padEnd(2, '0');
-
const COLS: [number, number, number, number] = [20, 30, 10, 15];
const logRow = (data: [string, string, string, string]) => {
diff --git a/packages/lambda/src/cli/helpers/date-string.ts b/packages/lambda/src/cli/helpers/date-string.ts
new file mode 100644
index 0000000000..482bff6760
--- /dev/null
+++ b/packages/lambda/src/cli/helpers/date-string.ts
@@ -0,0 +1,6 @@
+export const dateString = (date: Date) =>
+ date.getFullYear() +
+ '-' +
+ String(date.getMonth() + 1).padEnd(2, '0') +
+ '-' +
+ String(date.getDate()).padEnd(2, '0');