Custom Field - Date --> shows Time String with 00:00:00

hi forum
in version 21.1.20 win10 desktop the date field in custom fields shows a time string 00:00:00 in this field on printed documents. could not find a way to deselect the time in date field. any ideas ?

2021-01-13_123549

Probably related to

@WZM, what are you showing in your screen shot? Is this some transaction displayed with a custom theme? If so, you are responsible for performance of your theme, because Manager’s developer has no control over what you write. Manager uses times only for tagging actions in the History file.

I cannot reproduce the appearance of time strings in date-type custom fields.

hallo @tut,
the screenshot is showing part of a custom theme " delivery note ".
but time stamp is showing in all custom themes that use " date " as custom
field.
showing date only worked at least up to version 21.1.14
custom themes have not been modified for months.

so i think it must have something to do with time format selection field
in settings → dateandnumberformat → time format.
in version 21.1.14 time format selection is not available

see also patch s reply above

so please let me know please how to modify custom themes so that
it will import the date stamp only if date is selected for custom field
and not date stamp along with the 00:00:00 time stamp

thank you

I moved it to bugs and moved it back out of bugs because I cannot produce it. I added it to bugs category because you are not the first person to raise this issue.

I will keep trying with other date formats and see if I can reproduce it.

I’m not able to reproduce the issue. Can you post the part of your custom theme that is responsible for showing the date from custom field?

Looking into this further, I don’t think it is a bug.

Yes, something has changed but when you look how custom fields are presented in default theme, it’s usually

custom_fields[“Your custom field”].text

Not just

custom_fields[“Your custom field”]

So just make sure to add .text suffix into your theme where applicable.

hi lubos, here is the part of the custome theme which worked up to ver
21.1.14
showing the date stamp only.
in ver 21.1.20 ( and probably already in ver 21.1.18 when time format was
added )
it shows date and time stamp 00:00:00 as in the screenshots

</tr></table>
<div style="font-size: 14px; padding-top: 2px"></div>
 <div><b>Ihre Kunden-Nummer / Your Customer ID-No:</b> {{ recipient.code
}}</div>
 <div><b>Ihre Bestellung / Your Order:</b> {{ custom_fields["Ihre
Bestellung"] }}</div>
 <div><b>Bestelldatum / Order Date:</b> {{ custom_fields["Bestelldatum"]
}}</div>
   <div style="padding-top: 10px; font-size: 12px;
font-weight: normal; margin-bottom: 10px">{{ description }}</div>
</td>
</tr>

Is there a reason you have not done as described in detail in the above post

@WZM where you have

custom_fields[“Bestelldatum”]

replace for

custom_fields[“Bestelldatum”].text

@lubos

modified the code line as proposed to:

Bestelldatum / Order Date: {{ custom_fields["Bestelldatum"].text }}

it doesn t show anything on the document, neither date nor time stamp.

is the modification correct?

what you post looks good but is that what is actually in the custom theme code - post an image of the code

image of the code

I don’t know if this is a bug, but if you use the code which parses the custom field as a date and then print out the selected bits

{{custom_fields[“Bestelldatum”] | date: “%d %m %y”}}

it appears to decode the text as a date and print the date - but not in the right format so I don’t know if the %d %m and %y are being handled by Manager or not or if they are not the correct codes

I can confirm that adding .text does not work

@Joe91

{{custom_fields[“Bestelldatum”] | date: “%d %m %y”}}

shows the following:

Actually, only .NET date format is supported so it would need to be

{{ custom_fields[“Bestelldatum”] | date: ‘dd. MM. yyyy’ }}

As for the .text suffix, I will need to look into it.

Confirming that {{custom_fields[“Bestelldatum”] | date: “dd.MM.yyyy”}} gives 14.01.2021 for example

@lubos, @Joe91

confirm that it works ( may use both, single or double quotes for date
format )

thank you

1 Like

hi @lubos,
with regard to this " date " custom field issue, I think the according guide

https://www.manager.io/guides/17100

should be reviewed and updated
regards

What change to the Guide do you propose, @WZM ?