Jump to content

Date format backwards


Alisha

Recommended Posts

Hello,

I am using h_custom_21 in my capture for a date field and I want to map that to the summary of the request in the Business Process.

I have done this, but when I log a test request, it is putting the date in backwards, i.e. 2020-08-05 instead of 05-08-2020. Is there a way around this please?

Many thanks,
Alisha

Link to comment
Share on other sites

@Alisha the "backwards" format you mention is actually the UTC format for date/time and it's the format that is stored in the database. From what I know the formatting on these values only work when used in the UI or in email templates. I'll ask dev team to see if this should work when used as you do.

  • Thanks 1
Link to comment
Share on other sites

There is some information here on the wiki which may help.  If I understand correctly, you have a date stored in a custom date field and using the BPM you want to get this date from this field and populated it as part of the summary.  You can add some extra brackets around your variable and in the summary field of a request this is converted to the date format set under the user's profile.

image.png

  • Thanks 1
Link to comment
Share on other sites

Hi Alisha,

Yes, there is some documentation here under the Modifiers section regarding this.  The modifier in this case is formatLocalTime.  You need to add this at the end of your variable that you use in the email template.  The field that the variable refers to must be a date/time field.  You may also want to check the mentioned system settings to make sure that they are in the format that you are wanting.  

{{.datetimevariable|formatLocalTime}} = Allows formatting of date/time variables using system regional settings (system.RegionalSettings.timezone & system.RegionalSettings.dateTimeFormat). Without this formatting the date time will use the DB value (UTC).

I hope that helps.

Regards,

James

 

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

The modifier formatLocalTime only works with date/time variables/fields.  The summary field is a text field.  The date that you are displaying in the summary is still the original date format.  The extra square brackets that you add on the variable is just a markup to use the date in the users set timezone.  So, if you and I were both looking at the same request and the same summary, we would actually see a different date displayed as we are in different timezones.

Within Hornbill, we can interpret the square brackets in the text field to mark up the date to display the user's set timezone.  

image.png  

However, in the email template the date is being seen as as text, and unable to do the conversion.  If it was coming from a date field, it would know to convert the date.

Maybe there is something else that we also need to consider that is higher up the chain here.  What is the need to include the date in the summary? Would I be right in saying that this is a due date which you would like to be very visible and at the moment, outside of the Service Targets, there is no due date field that accomplished this?

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...