Changing Date Based Upon Value from Category Field
I have a @Rent Frequency field (this is a category), and a @Contract Start Date (this is a date).
I wish to create a new date (next payment date) taking the Contract Start Date and adding the Rent Frequency to create the next date. I then want to get Globiflow to create multiple items until the @End Date.
E.g., if the start date was 1 Jan and the frequency was "Monthly", and the End Date was 31 Dec, I want a payment created first on (1 Jan + 1 Month) (=1 Feb), and then continue until 1 Dec.
my calculation is as follows:
var p = @Rent Frequency;
var c = @Start Date;
var period =
{
Daily:1,
Weekly:7,
Biweekly:14,
4 Weekly:28,
Monthly:1,
Quarterly:3,
Half Annually:6,
Annually:1,
Once Only: 0
};
var type =
{
Daily:d,
Weekly:d,
Biweekly:d,
4 Weekly:d,
Monthly:M,
Quarterly:M,
Half Annually:M,
Annually:Y,
Once Only: d
};
moment(c).add(period[p],type[p]).toDate()
I originally tried this in a variable field in globiflow, but couldn't get this to work, so tried in a podio calculation hidden field, but again no luck. Any advice please?
-
Very interesting question and idea, did you find a solution, Jamie Oarton?
Please sign in to leave a comment.
Comments
1 comment