Skip to content

Commit

Permalink
sandbox: make filter parsing more tolerant; add hint for IN expression
Browse files Browse the repository at this point in the history
  • Loading branch information
jkissel committed Nov 29, 2023
1 parent 0128344 commit 75b42f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
}

function parseFilterVariables (filterString) {
return JSON.parse(filterString, (_, value) => {
return JSON.parse(filterString.trim(), (_, value) => {
if (value === '{{currentDate}}') { // convenience for current date
return new Date();
}
Expand Down Expand Up @@ -258,6 +258,7 @@
<small>
<p>A JSON object with filter variable names and values</p>
<p>Dates need to be ISO strings<br>(e.g. <code>"2023-11-17T17:12:06.175Z"</code>).<br>Use <code>"{{currentDate}}"</code> for the current date.</p>
<p>Pass multiple values for an <code>IN</code> expression as <code>["a", "b", ...]</code></p>
</small>
</div>
</template>
Expand Down

0 comments on commit 75b42f1

Please sign in to comment.