If I understood your case, you are putting the using the Java library path in one action and trying to execute its functions in another action. As far as I know, you have to put the path to the library and functions in the same action.
I cannot really judge about this.
What happen if you click the Play button at the top right corner?
I got it. Maybe the path to library is wrong. You may need to put full path. In my case "/storage/emulated/0/Tasker/Scripts/moment.js" without double quotes.
Am Dienstag, 30. August 2016 16:17:48 UTC+2 schrieb Abdullah Alahdal:I got it. Maybe the path to library is wrong. You may need to put full path. In my case "/storage/emulated/0/Tasker/Scripts/moment.js" without double quotes.
YES!!! Thank! Now it works.
Test (202)
A1: Variable Set [ Name:%start_date To:'01.01.2016' Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%end_date To:'31.12.2016' Do Maths:Off Append:Off ]
A3: JavaScriptlet [ Code:var result = moment(end_date).diff(moment(start_date), 'days'); Libraries:/storage/sdcard0/Tasker/JavaScript/moment.js Auto Exit:On Timeout (Seconds):10 ]
A4: Flash [ Text:%result Long:Off ]
Code hier eingeben...Test (202)
A1: JavaScriptlet [ Code:var start_date = '01.01.2016';
var end_date = '31.12.2016';
var result = moment(end_date).diff(moment(start_date), 'days'); Libraries:/storage/sdcard0/Tasker/JavaScript/moment.js Auto Exit:On Timeout (Seconds):10 ]
A2: Flash [ Text:%result Long:Off ] Code hier eingeben...I think the issue is with the date format, I tried your example with different date format and it works.