Using Built-In Functions in Javascript Block

Using Built-In Functions in Javascript Block

  

Hey guys!

I'm trying to integrate FullCalendar into a mobile app.

Need to convert the moment received into DateTime but i am unable to do the conversion.


Trying to use the OS conversion function 'TextToDateTime' but i can't seem to find a way to access it.


Thanks for your help


Best,

Barnett

Solution

Hi Barnett,

Why not return set the currentDateTime output parameter to type Text and once back in the your client action after the javascript flow element then use the build in function TextToDateTime function?

More low-code solution, you always want to code as less possible Javascript.

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi Barnett,

Why not return set the currentDateTime output parameter to type Text and once back in the your client action after the javascript flow element then use the build in function TextToDateTime function?

More low-code solution, you always want to code as less possible Javascript.

Regards,

Daniel

Hi Daniel,

Did try thinking of doing that but I thought it would be better for the Javascript side to output the correct type of data ie DateTime instead of Text. I realised that DateTime in outsystems is basically a Javascript Date so i could do .toDate() and it would be correctly assigned under the DateTime Type.

Your solution is definitely a good alternative. I need to get better thinking in terms of 'low-code'!

Best,

Barnett