Skip to content

Commit

Permalink
Fix Date filters in youtube node
Browse files Browse the repository at this point in the history
  • Loading branch information
ShireenMissi committed Sep 6, 2024
1 parent 6ea0856 commit a3269e3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/nodes-base/nodes/Google/YouTube/YouTube.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { videoFields, videoOperations } from './VideoDescription';
import { videoCategoryFields, videoCategoryOperations } from './VideoCategoryDescription';

import { isoCountryCodes } from '@utils/ISOCountryCodes';
import { DateTime } from 'luxon';

const UPLOAD_CHUNK_SIZE = 1024 * 1024;

Expand Down Expand Up @@ -762,6 +763,14 @@ export class YouTube implements INodeType {
qs.type = 'video';

qs.forMine = true;
if (filters.publishedAfter)
filters.publishedAfter = DateTime.fromISO(filters.publishedAfter as string)
.setZone(this.getTimezone())
.toISO();
if (filters.publishedBefore)
filters.publishedBefore = DateTime.fromISO(filters.publishedBefore as string)
.setZone(this.getTimezone())
.toISO();

Object.assign(qs, options, filters);

Expand Down

0 comments on commit a3269e3

Please sign in to comment.