NetTalk Central

Author Topic: Time entry format problem  (Read 3242 times)

GordonF

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Time entry format problem
« on: September 27, 2021, 04:24:54 AM »
I have an issue where seemingly similar time entry fields on a form are formated hh:mm or sometimes hh:mm:ss even though I've selected hh:mm from the picture dropdown, on examining the generated code it produces:

packet.append(p_web.CreateInput('time','TRPH:TRIContactTime',p_web.GetSessionValue('TRPH:TRIContactTime'),loc:fieldclass,loc:readonly,clip(loc:extra) & ' ' & clip(loc:autocomplete),'@T06B',loc:javascript,p_web.PicLength('@t01'),'Triage Contact Time','TRPH:TRIContactTime',,'imb',,,,'UpdateTriage')  & p_web.CRLF) !a

As you can see it has a picture of @T06B, I checked NetWeb.tpw and the @T06B is hardcoded into the template as below

%gPacket.append(p_web.CreateInput('time','%FormField',p_web.Get%ValueScope(%DataField),loc:fieldclass,loc:readonly,clip(loc:extra) & ' ' & clip(loc:autocomplete),'@T06B',loc:javascript,%mltemp,%FormFieldTooltip,'%FormId',%FormFieldPlaceHolder,%datado,%vNumLow,%vNumHigh,%vNumStep,'%procedure')  & p_web.CRLF) !a

Should it not be using %FormFieldPictureTime as in the template code below, I changed the template and the fields now work as expected.

%gPacket.append(p_web.CreateInput('time','%FormField',p_web.Get%ValueScope(%DataField),loc:fieldclass,loc:readonly,clip(loc:extra) & ' ' & clip(loc:autocomplete),'%FormFieldPictureTime',loc:javascript,%mltemp,%FormFieldTooltip,'%FormId',%FormFieldPlaceHolder,%datado,%vNumLow,%vNumHigh,%vNumStep,'%procedure')  & p_web.CRLF) !a

Am I missing something and so shouldn't change the template?

NT12.17 I'll be moving to 12.26 in the next couple of days.

Gordon


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Time entry format problem
« Reply #1 on: September 27, 2021, 07:53:25 PM »
The "Time" field type uses the Browser <input type="time>.

The browser is then free to capture the field anyway they like, and in whatever format they like, although all seem to use some variation of hh:mm or hh:mm:ss. The AM/PM depends on the system locale of the user's machine.

There is a small tweak necessary for 12.27 - up to 12.26 it did not support the hh:mm:ss variation, only hh:mm.

Your template tweak is fine.

Cheers
Bruce