ServiceDesk

How To Translate the DateTime value of the Workflow DateTimePicker Component 

Nov 13, 2014 03:28 PM

The Workflow DateTimePicker component uses the Language definition from your Browser to determine the format of the 'Output Data' variable.
Here is what Firefox could say:

Browser_Language.png

In this example, the DateTimePicker component will use the 'ar-dz' Language since it is at the top of the list.

Let us say that you would like to use the DateTime value in a Custom Search Form that specifies a Date Range for the search criteria.
You will encounter the following error if the DateTime format is not compatible with your Database Language.

The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

The Database language can be discovered with this query:  select @@language

The attached project demonstrates a method for translating the Browser Language DateTime format to 'en-US'.
In theory, you will be able to set your Browser to any Preferred Language and still be able to perform Date Math with our ProcessManager database.
The project uses the DateTimePicker component for input to this SQL query:

select ReportProcessID, CAST(ProcessStarted AS SMALLDATETIME) AS [ProcessStarted] FROM ReportProcess where ProcessStarted > @StartDate

The Language Translation is performed by the 'Map Browser Language to en-US' Code (Script) Component.

NOTE: This project was built on: Workflow 7.5.3000.4584

Statistics
0 Favorited
1 Views
1 Files
0 Shares
1 Downloads
Attachment(s)
package file
Browser Language DateTime Test.package   182 KB   1 version
Uploaded - Mar 11, 2020

Tags and Keywords

Related Entries and Links

No Related Resource entered.