kontent-ai / delivery-sdk-js

Kontent Delivery SDK for Javascript
https://kontent.ai
MIT License
50 stars 34 forks source link

Range filter gives type error when arguments are date strings #367

Closed Nickm615 closed 1 year ago

Nickm615 commented 1 year ago

Brief bug description

When using the range filter in a typescript project, providing date/time strings as arguments causes a type error 'argument of type 'string' is not assignable to parameter of type 'number.' Based on our documentation this should be supported https://kontent.ai/learn/tutorials/develop-apps/get-content/filter-content-items-examples/?tech=typescript#a-range-of-dates-and-numbers

Repro steps

Create delivery client in typescript file Apply range filter with date/time strings as arguments

Expected behavior

TS does not flag this with error

Test environment

Node 18.16.0

Additional context

Add any other context about the problem here.

Screenshots

Add links to screenshots, if possible.

Enngage commented 1 year ago

Fixed by https://github.com/kontent-ai/delivery-sdk-js/pull/368