Change the date output format on the 'Print' button

Questions related to customising nuBuilder Forte with Javascript or PHP.

Change the date output format on the 'Print' button

Postby kknm » Thu Jul 09, 2020 8:04 pm

When using the standard print button of the viewing form, the date in the format 2020-06-12 08:00:00 is displayed.
I would like to see this date in the format 12.06.2020 08:00
kknm
 
Posts: 143
Joined: Sat Apr 11, 2020 7:33 am

Re: Change the date output format on the 'Print' button

Postby Janusz » Thu Jul 09, 2020 9:38 pm

In the Form / Browse / Display field you need to define the format you want:
For example:
if your your field would be:

ofe_updated

replace it with:

Code: Select all
DATE_FORMAT(ofe_updated, "%d/%m/%Y %h:%i")


the Format field should stay empty.
Janusz
 
Posts: 325
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Change the date output format on the 'Print' button

Postby kknm » Thu Jul 09, 2020 9:48 pm

Janusz wrote:In the Form / Browse / Display field you need to define the format you want:
For example:
if your your field would be:

ofe_updated

replace it with:

Code: Select all
DATE_FORMAT(ofe_updated, "%d/%m/%Y %h:%i")


the Format field should stay empty.

Where is
"Form / Browse / Display field" ? Do I need to create it?
kknm
 
Posts: 143
Joined: Sat Apr 11, 2020 7:33 am

Re: Change the date output format on the 'Print' button

Postby Janusz » Thu Jul 09, 2020 9:52 pm

When you are on the form you want to modify press
CTRL+F
Next go to Browse Tab.
Janusz
 
Posts: 325
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Change the date output format on the 'Print' button

Postby Janusz » Thu Jul 09, 2020 9:53 pm

CTRL+SHIFT+F
Janusz
 
Posts: 325
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland

Re: Change the date output format on the 'Print' button

Postby kknm » Thu Jul 09, 2020 11:06 pm

Janusz wrote:CTRL+SHIFT+F

Thank !
It was necessary to explain what is being done in the field that needs to be formatted.
kknm
 
Posts: 143
Joined: Sat Apr 11, 2020 7:33 am

Re: Change the date output format on the 'Print' button

Postby kknm » Tue Jul 14, 2020 9:29 pm

Janusz wrote:In the Form / Browse / Display field you need to define the format you want:
For example:
if your your field would be:

ofe_updated

replace it with:

Code: Select all
DATE_FORMAT(ofe_updated, "%d/%m/%Y %h:%i")


the Format field should stay empty.

Everything turned out, but the next problem appeared ... After I formatted the field for subform, it stopped working in the filter for the subform. I had to additionally enter the 'tab_data' field with width = 0 for subform, but now 2 fields with formatted and unformatted fields are printed from the main form. How to remove an unformatted field out of print?
kknm
 
Posts: 143
Joined: Sat Apr 11, 2020 7:33 am

Re: Change the date output format on the 'Print' button

Postby Janusz » Tue Jul 14, 2020 10:01 pm

With standard print procedure as far as I know you can not exclude specific fields. Maybe try to redefine the filter format to comply with new date format if possible.
Janusz
 
Posts: 325
Joined: Fri Dec 28, 2018 10:11 pm
Location: Krakow, Poland


Return to Custom Code