PDA

View Full Version : cWebDateForm problem



Sture
6-Nov-2020, 08:18 AM
I have found a problem with the cWebDateForm in 19.1 and now I see it is also in 20B1.


In the webordermobile click create new order.
Edit the date suggested to a week ago
Click the prompt button to get the calender



ok, in my desktop browser and on my ipad it's fine. The calendar pops up marking the current date of the cWebDateForm (a week ago)

BUT ON MY IPHONE, clicking the prompt button immediately sets the value of the cWebDateForm to today. I have just delivered a system to a customer with this in it, so I'm eager for a workaround.

(and btw, I see no difference between setting pbHtml5NativeOnMobile or not)

-Sture

Samuel Pizarro
6-Nov-2020, 08:41 PM
Yep, confirmed here too.

Harm Wibier
9-Nov-2020, 03:20 AM
I can reproduce it (took a while to figure out that I shouldn't change it the first time using the prompt but edit it with the keyboard). The date picker looks completely different than the last time I looked at it, so Apple must have updated it. We will look into it.

Sture
9-Nov-2020, 08:34 AM
Thank you harm

Sam Cannone
11-Nov-2020, 05:36 AM
Hi Sture / Harm,

I am trying to utilise the cWebDateForm ( 19. 1 ) with a datetime datatype , clicking on the calendar button initially will automatically set the date and time , but when I select a date from the popup it sets the time part to 01:01:01 .. Is there a way around this so that it doesn't change the time part when selecting from the popup ?

Sam

Sture
11-Nov-2020, 09:24 AM
Hi there,

Here is a very simpel solution until a more thorough one is achieved. No javascript or CSS needed for this one.

14097

If dates outside 1900-2025 are needed, or if seconds are needed, adaptions must be made. Or if you need D/M/Y appearing in another sequence.

-Sture

Mike Peat
11-Nov-2020, 10:04 AM
It would be nice if this could be combined (hint: by DANL, perhaps) with the existing date-picker component. I tried to do this a while ago but did not get very far.

Mike

Sam Cannone
11-Nov-2020, 04:58 PM
Hi Sture,

Thank you .. it will do the job ..

Sam

Sam Cannone
11-Nov-2020, 04:59 PM
Yes please :)

Sam Cannone
11-Nov-2020, 07:12 PM
Hi Sture,

I couldn't resist .. so I made a couple of changes including making it data aware ... it returns the date in DD/MM/YYYY format , but any user can change ..

Also the css I used



.Rounded {
opacity: 1;
transition: 500ms;
transform: translateX(0);
transform-origin: left;
}
.Rounded .WebWin_header {
display: none;
}
.Rounded .WebWin_main_l,
.Rounded .WebWin_main_l > .WebWin_main_r,
.Rounded .WebWin_main_l > .WebWin_main_r > .WebWin_main_c,
.Rounded .WebWin_main_l > .WebWin_main_r > .WebWin_main_c > .WebContainer {
border-radius: 5px;
}
}



Sam

Sture
16-Nov-2020, 10:39 AM
Cool, I'll store it with my control :-=

-Sture

Harm Wibier
18-Nov-2020, 02:17 PM
The following JavaScript should fix it:


// HotFix for calendar not showing right date on IOS (HW, DAW, 2020/11/18)
if(df.pnDataFlexVersion == 19.1){
/*
Augment setControlValue to also update the hidden date field when it is used.

@param sVal New value.
*/
df.WebDateForm.prototype.setControlValue = function(sVal){
df.WebDateForm.base.setControlValue.call(this, sVal);

// Also update the hidden date field as updating it when opening it is too late for IOS
if(this._eHtml5HiddenDate){
this._eHtml5HiddenDate.value = df.sys.data.dateToString(this._tValue, "yyyy/mm/dd", "-");
}
}

}

Sture
18-Nov-2020, 06:39 PM
Oh, that's great. Will try it out tomorrow.

Thank you Harm

-Sture

Sture
20-Nov-2020, 03:30 AM
Hi Harm,

Just tested, an it now works on iPhone.

However, in desktop chrome (and google) it has this behavior of inserting today at the moment you click the calender bottom when the the dateform is empty (instead of waiting until 'ok' is clicked). On iPhone it is ok.

(I have not tested other browsers)

-Sture

Harm Wibier
23-Nov-2020, 04:00 AM
Thanks!

The desktop behavior you describe is pretty much by design and not new in 20. I say pretty much because I agree that it might seem strange to users when just clicking the prompt button. Using the keyboard (F4 > Arrow keys / Page Up / Page down) then it makes a lot more sense. And of course when the form already has a date it also is fine..

Sture
23-Nov-2020, 04:52 AM
ok, thank you Harm.

-Sture