function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Date Literal to JavaScript

Salesforce does a great job of providing date literals, i.e. THIS_WEEK, THIS_QUARTER, etc... Has anyone found a JavaScript library that provides this translation?


Could you elaborate on your use case? You can use those date literals from JavaScript when querying (via sforce.connection.query, for example). Of course, it would be trivial to write your own library that provides those same type of constants, as the Date object in JavaScript is fairly robust.

Indeed, fairly trivial. I just went with a library from