Silk UI Pikaday Calendar problem with time init

Silk UI Pikaday Calendar problem with time init

  

I like to work with Outsystems.

I am using SilkUI Pikaday calendar widget to select date and time. I would like to init it to have current date and time. Date works fine, but time seems to be always 00.00. I found, that problem is, that in JavaScript side variable used is Date instead of Date Time, so I changed it to Date Time and now it seems to work just fine. Now I wonder, that is that just a bug in widget or is there a reason behind this? Am I expected to see some problems in some circumstances? (For example with Timezone, daylight saving, running in different devices/browsers etc.)

If not, would it be possible to get init time support also in official version?

Thank you!

Hi Esa,

Do you have the latest version of the Silk UI Web component?

I ask this because in my apps it works as it's supposed and there was an update 2 months ago that fixed something related to when using a DateTime variable:

http://www.outsystems.com/forge/Component_Versions.aspx?ProjectId=916

Cheers,

José

Oh, I wasn't aware, that silk ui can/must be updated separately. I thought, that it is updated together with service studio, so I had Mobile patterns version 1.2.1. (Included in service studio 10 installation in Mar 2017?) Thank you for guidance! Now I know to keep my silk ui updated. :-)

I think, that it would be nice to get (maybe optionally) also silk ui updated during service studio updates, or at least reminder to update related components when service studio is updated.

Esa Saarinen wrote:

Oh, I wasn't aware, that silk ui can/must be updated separately. I thought, that it is updated together with service studio, so I had Mobile patterns version 1.2.1. (Included in service studio 10 installation in Mar 2017?) Thank you for guidance! Now I know to keep my silk ui updated. :-)

I think, that it would be nice to get (maybe optionally) also silk ui updated during service studio updates, or at least reminder to update related components when service studio is updated.


I updated to latest silk UI version (3.1.5) and replaced my clone of calendar widget with official widget and problem is still there. JavaScript takes init value in as Date variable so we loose time info, see attached pic. In other words, if you init calendar with CurrDateTime() and open calendar, you have correct date selected, but initial time is always 00:00. So my initial question was: 

1. Was this just a bug or is there reason behind this so there is expected some side effects in my fix to change variable type here (see pic) to DateTime? 

2. Will there be fix in official version?

Esa, 

I will do a question but please, don't get me wrong. I already did that.
Did you refreshed the reference and published your application again?

Just to be sure this is not the problem.

Cheers,

Eduardo Jauch

P.S. I'm looking to the "inputCalendar" options. If it is another component, I beg your pardon.

Yes, refreshed references. Attached pic in last message is from latest official version, so you can see, that Date variable in Javascript can't hold date and time information.  (Your pic is from outsystem side, not Javascript as mine. You need to open Mobile patterns e-space and there calendar init javascript function to see the problem)

Solution

Esa,

I see now.
Yes, the InitialDate property in the widget is a DateTime, but in the JavaScript is only Date.
From the description of the property, it is to define the "date" in which the calendar will start, not the "date time".

Can be a bug, and it seems this way, as it accepts a DateTime as its value in the property.

As a workaround, I'll suggest you to set the "initial date" through the variable that is bounded to the input.
This way, when you open the calendar, it will be on the desired date and time.

Cheers,

Eduardo Jauch

Solution

Now I noticed, that I forgot to include crucial information here. I am talking about mobile silk ui calendar component. So updating silk ui web didn't help. :-| (Now it makes more sense why my old version was 1.2.1 :-) ) 

I updated silk ui mobile, but situation is still the same. So I think problem is in onReady function, init Javascript part,  see my previous pic. I hope now you can reproduce  my problem.

Hi ESA, 

I would say the JavaScript function code is basically the same both on mobile and web.
And I can reproduce the problem on Web as well.

So, my suggestion as workaround is to define the value of the variable associated to the input and forget the Initial Value.

Cheers,

Eduardo Jauch