cancel
Showing results for 
Search instead for 
Did you mean: 

Due Date - Javascript

davedran
Champ in-the-making
Champ in-the-making
Hi!

I am trying to filter and list all records that will be due in 7 days.

Is this correct?

var now = new Date();

var filter = {filterSmiley Very HappyueByDate:[MIN TO \"" + (now.getDate()+7)  + "\"]};

Thank you.

David
3 REPLIES 3

rjohnson
Star Contributor
Star Contributor
I believe that the dates must be ISO8601 with the - quoted.

kaynezhang
World-Class Innovator
World-Class Innovator
It depends on what record you want to filter and where.
By Due Date I guess you mean to use a filter on tasks page or on workflow instance.If so you can use dueBefore and dueAfter paramter in webscript api url.I you want to search the model directly use dueDate property  in iso08601 format.

davedran
Champ in-the-making
Champ in-the-making
Hi!

Thank you for your replies.

I did the following and it almost works

var filters = [label:"Due next 7 days ",filter:"@dueDate:[MIN TO \"" + now.getFullYear() + "-" + (now.getMonth()+1) + "-" + (now.getDate()+7) + "\"]"}];

It will list all of due records that will due within next 7 days, but it will also list all records that dates are less than today's date.


I only need to list records that are GTE (than today) and LTE (7 days from today).

I was not able to find any method in JavaScript called dueAfter (which sounds prefect for my need), that will list all due date from today and show records for next 7 days.

Appreciate your guidance.

Thank you.

David