06-20-2018 10:51 AM
I am attempting to write javascript for a script snap to manipulate dates, times, and date/times. I am having issues getting a date field plus a separate time field parsed as a DateTime and further having issues when I need to add a duration of time to the DateTime. Are there any examples of this somewhere?
Doug
06-29-2018 11:56 AM
punchInDate is in “yyyy-MM-dd”
punchInTime is in “HH:mm”
punchIn should be something like “MM/dd/yyyy HH:mm”, or “yyyy-MM-dd HH:mm”, or “MMddyyyyHHmm”, etc.
06-29-2018 12:01 PM
@doug.fossler
Use this-
$punchInDate.toLocaleDateString(‘{“format”:“yyyy-MM-dd HH:mm”}’
if punchInDate is coming as date field , if it’s coming as String then 1st do Date.parse($punchInDate), then use formater in mapper snap
06-29-2018 12:08 PM
I am not doing this inside a mapper snap, i am attempting to do this in javascript inside a script snap on purpose.
06-29-2018 12:14 PM
use mapper only. Why need to have script snap? always trying to ignore script as much as possible.
06-29-2018 12:23 PM
My use case will not allow this to be handled in a mapper. Unless you can tell me how to edit multiple docs based on the prior edits of said docs? I am aware of array’s but they would not solve the problem.