input calendar widget - set the currdatetime in the inputbox

input calendar widget - set the currdatetime in the inputbox

  

Hi


I have an input box and it is bind to an input calendar widget. I want that (whenever) someone opens the pop up it shows the currdatetime() in the input box. I managed to do it through the preparation as it seems we cannot use the widget to set the current date in the input box. Initial date parameter only set the date in the calendar itself, not in the input box. Show time was set to true and it only serves to show the hours and minutes in the calendar, not in the input box. Is there any way to show the CurrDateTime() in the input box without using the preparation? Thanks! 






Hello Jorge.

You need to explain better what you are trying to do and what are you using...

Which calendar widget are you using?
Show the time in the input is a requirement?

If it is from RichWidget, there are two ways.

Defining the initial value of the variable associate with it (and I think a CurrDateTime() in the default value probably will work, didn't tested).

Or through JavaScript (you can do almost anything of this type of things with JavaScript...).

If you use the SilkUI calendar, if I am not mistaken, setting the Start/Initial Date sets the value in the input (didn't tested thou).

As to show the time in the input, what type of variable are you binding to the input? DateTime? If so, it should appear. If it is Date, I think it will ignore the time in the input.

Cheers.

TO do: show the current date time in the INPUT BOX (as I already told).

I am using the INPUT CALENDAR from the Rich Widget. (silk UI is not installed) 

I have used a local variable which is bind to the input box, in the preparation I just set an assign telling the local variable is the CUrrDateTime() and it works. I would like to know if without using js or without using SILK UI,  there is a way (ANOTHER WAY) to show the current date time in the input box. 

"Defining the initial value of the variable associate with it (and I think a CurrDateTime() in the default value probably will work, didn't tested)."   If you refer to the Initial DATE of the INPUT CALENDAR it will only show it in the calendar, not in the input box.  With the RICH WIDGET input calendar, I suppose (without use of js) the only way to set currdatetime() in the input box is through the preparation. 


"As to show the time in the input, what type of variable are you binding to the input? DateTime? If so, it should appear. If it is Date, I think it will ignore the time in the input."

yes. it has date time type. with this rich widget it does not show the date in the input box. that's why i have used the preparation to force the current date time to appear in the input and it worked this way. 



Solution

Jorge Almeida wrote:

TO do: show the current date time in the INPUT BOX (as I already told).

Yes, but the way you put the question was confusing, so I was not sure exactly "when" you wanted that, like, only in the first time or every time the user pick the calendar?

I am using the INPUT CALENDAR from the Rich Widget. (silk UI is not installed) 

I have used a local variable which is bind to the input box, in the preparation I just set an assign telling the local variable is the CUrrDateTime() and it works. I would like to know if without using js or without using SILK UI,  there is a way (ANOTHER WAY) to show the current date time in the input box

Not that I know.

"Defining the initial value of the variable associate with it (and I think a CurrDateTime() in the default value probably will work, didn't tested)."   If you refer to the Initial DATE of the INPUT CALENDAR it will only show it in the calendar, not in the input box.  With the RICH WIDGET input calendar, I suppose (without use of js) the only way to set currdatetime() in the input box is through the preparation. 

The default value is the Variable default value. And as I said, other than using JavaScript, with RichWidget calendar, you need to set the variable value during preparation (or through the variable default value) to the current date time to appear in the input.

"As to show the time in the input, what type of variable are you binding to the input? DateTime? If so, it should appear. If it is Date, I think it will ignore the time in the input."

yes. it has date time type. with this rich widget it does not show the date in the input box.

In your first post, you said: Show time was set to true and it only serves to show the hours and minutes in the calendar, not in the input box 

The interpretation of this phrase is that your problem was showing the Time part of the Date Time.

But now, you are saying the problem is that the Date does not appear in the input. WHen? When you select the date & time from the picker or when you assign the value to the bound variable? Only the Date part is missing?
The enitre selected date does not appear?

Cheers

Solution

ok. so i did it right. It is a very simple way to use the preparation instead of using js for unnecessary effort to show only the current date time in the input box. yep, the easier way would be to use the SILK UI calendar widget. ;) 

I am always try to figuring out for the best approaches and clean ways to do functionalities, THAT'S why I came here to ask for alternatives :) .


But now, you are saying the problem is that the Date does not appear in the input. WHen? When you select the date & time from the picker or when you assign the value to the bound variable? Only the Date part is missing?
The enitre selected date does not appear?

ah. when I do not force in the preparation the date time to appear in the input box, it does not show the date in the input box. In the input box it only appears YYYY-MM-DD HH:MM:SS if I take off the assign I had in the preparation. If I put that assign in the preparation, the input box is set to 2018-02-01 11:18:00 when I wrote this post. ;) it does what I want to show. 


thanks for your input, Eduardo. Cheers.


Hello Jorge :)

Trying to figure out the best way to do something is good. I personally like this kind of questions.
But the question itself must be put in a way that make our life easier to understand what exactly you did and what exactly are you asking... ;)

In the end, you don't have a problem. Everything is working as expected, the best way possible.

As I type this, If you didn't marked any answer as correct, please, chose one. :)
Cheers.