gs.daysAgoStart(0) vs gs.beginningOfToday()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 07:23 AM
Date input fields and fields values (labels) for filter component:
I'm using the value "javascript:gs.daysAgoStart(0)" (before Today) which is not translated correctly in snDateChoiceElement.js to "before Today" because snDateChoiceElement.js looks for values from a list, and "javascript:gs.daysAgoStart(0)" is not included there.
Instead, there is the 'before: "javascript:gs.beginningOfToday()"' under Today filter. If I replace "javascript:gs.daysAgoStart(0)" with "javascript:gs.beginningOfToday()" then I get the desired value (label of "Today").
Why are the *Ago*(*) format not supported and is there a java\javascript utility that translates the *Ago*(*) values to *beginningOf*(*) values?
Thanks
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2018 11:49 PM
Hi
Maybe this "Moment.js" library of javascript will help you get going with this concern of yours. Refer to the link below.
Or in Javascript do the following code :-
var date = new Date();
date ; //# => Fri Apr 01 2011 11:14:50
date.setDate(date.getDate() - 1);
date ; //# => Thu Mar 31 2011 11:14:50
Mark Correct or Helpful if my answer helped you.
Regards,
Omkar Mone.
www.dxsherpa.com