+ 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 salesforce.com (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 MomentJS.com