neoDate Plugin (added neoDateDifference) - Forum

Forum Navigation
VisualNEO Products: Web, Win and PixelNEO
You need to log in to create posts and topics.

neoDate Plugin (added neoDateDifference)

I have enhanced the neoDate plugin to enable developers to obtain the difference between two date objects. The result can be requested in Milliseconds, Seconds, Minutes, Hours, Days, Weeks, Months, Quarters or Years ... the (maximum) number of decimal points can also be specified.

Please download and install the new version of the (beta) plugin, and the updated Tutorial, and advise me about any errors or omissions.

Uploaded files:
  • You need to login to have access to uploads.

@gaev

Cool! Thank you very much!!

Thank you Gaev !

Thank you @gaev

 

Thanks You Gaev !!!!

Thank you @gaev!! :)

Hi @gaev/,@luishp

One question.

It's possible to obtain this format (extracted from tutorial): "2009-03-19 4:34:15.123 am" "YYYY-MM-DD h:mm:ss.SSS a" in order to calculate differences, using Date and Time Input Objects ?. I can't find the way to format the output of the variables, or it's only possible using javascript ?.

date input object output is: "2020-11-10T03:00:00.000Z"

time input object output is: "1970-01-01T19:29:00.000Z"

I was using this taken from another post but again with no results because only give to me date / time without seconds or miliseconds.

BeginJS
$App.myvar1=$("#DateInput1").val();
$App.myvar2=$("#TimeInput1").val();
EndJS

The output of about combined with Date and Time Input Objects variables is:

date: 2020-11-10

time: 16:26

Best regards,

Sam

Well, using moments library i do this as start point:

BeginJS

var today = $App.dia1;
moment.locale ("es");
var dia1 = moment(dia1).format('YYYY-MM-DDTHH:mm:ss.SSS dddd');
$App.dia1 = dia1;

EndJs

output format:

Your date/Time: 2020-11-22T17:07:59.511 domingo

I guess this could be the way, the only problem with this is that i'm not getting the date that i put inside Date Object but the actual date.

Regards,

Sam

@lesanch take a look at the Time/Date commands on the Actions panel to get year, month, day, hour and minutes from the Date and Time objects.

Regards.

Uploaded files:
  • You need to login to have access to uploads.

Hola @luihp, perdona, debe ser por la versión que tengo que no veo justo esa parte de la hora.

Saludos,

Sam

Uploaded files:
  • You need to login to have access to uploads.

@lesanch esa parte fué añadida en la última actualización, me temo.
Ahora no tengo tiempo de buscarlo pero hay un código equivalente en JavaScript publicado en el foro.
Si encuentro el momento lo busco y publico el enlace aquí mismo.

Saludos!

@lesanch

date input object output is: "2020-11-10T03:00:00.000Z"
time input object output is: "1970-01-01T19:29:00.000Z"

Try this ...

... your outputs
SetVar "[myDate]" "2020-11-10T03:00:00.000Z"
SetVar "[myTime]" "1970-01-01T19:29:00.000Z"

... separate date components from time components
StrParse "[myDate]" "T" [myDateArray]
StrParse "[myTime]" "T" [myTimeArray]

... combine date component of first variable with time component of second variable
SetVar [myDateTime] "[myDateArray(0)]T[myTimeArray(1)]"
...AlertBox "myDateTime" "[myDateTime]" ""

... now create the required neoDate object
neoDateCreate [abcd] "[myDateTime]" "YYYY-MM-DDTHH:mm:ss.SSSZ"

... verify (optional)
neoDateAsString [abcd] "YYYY-MM-DD HH:mm:ss.SSS" [abcdStr]
AlertBox "abcdStr" "[abcdStr]" ""

Hope that was what you were trying to solve.

 

@lesanch, este es el enlace que te decía:
https://visualneo.com/forum/topic/consulta-sobre-entrada-de-hora

Saludos!

Hi @Luishp / @Gaev,

I will try your solutions.

Thank you very much,

Sam.

Open chat
1
Do you need more info?
Hi, do you have any doubt?