› Forums › Classic DFFS › Convert Text to Date ad update field
Tagged: cascading drop downs, DFFS, rules
- This topic has 3 replies, 2 voices, and was last updated 5 years, 9 months ago by Alexander Bautz.
May 23, 2017 at 16:06 #16651Phil MeachamParticipant
I have two lists, a timeline list and a task list, both are task content types.
I use vLookup so that I can associate the tasks to the timeline.
On the task list, when you create a new item, I have cascading drop downs to select the related timeline. So you select category and then the task.
Once you have this, it then pulls in the Due Date of the related timeline.
I then want to store this due date as a Date column, using a rule.
The problem I have, when I pull the due date into the text field, it’s formatted as “2017-09-18 00:00:00” for example.
I need to then somehow, convert this to a date so that I can do a comparison and ensure that a task due date isn’t being made that is beyond the due date of the milestone.
Does anyone have any idea how I might achieve this or how I can convert the text date format to a normal date format so I can then run the comparison.
Thanks in advance!!
- This topic was modified 5 years, 10 months ago by Phil Meacham.
June 2, 2017 at 17:58 #16749Alexander BautzKeymaster
I’m sorry for not replying earlier. You find a function in DFFS that converts this “ISO8601” formatted string to a proper date object:
var date = spjs.dffs.iso8601ToObj("2017-09-18 00:00:00");
June 7, 2017 at 16:20 #16790Phil MeachamParticipant
Thanks for this Alexander, how do I put this in to the form though? Do I do it in the value part of the rules section?
June 8, 2017 at 21:02 #16804Alexander BautzKeymaster
Sorry, I thought you already used custom js and could use this snippet to convert it.
If you use a rule to write the date from the cascading dropdown field and to the date field you could try using a calculated column as source of the cascading dropdown (to have the format correct from the start). Set the formula of the calculated column like this:
Change the “MM/dd/yyyy” to match your date format.
- You must be logged in to reply to this topic.