Skip to main content
Planview Customer Success Center

How to make an Intelligent Forms form compatible with different browser language settings

Issue

SmartIQ formats dates and numbers in forms according to the browser language, which works fine if you are using Changepoint connectors because they are coded to handle this scenario.

However, calling stored procedures can result in issues. For example:

  • the form is created in the English (United States), which uses the date format mm/dd/yyyy
  • the user's browser locale is set to English (United Kingdom), which uses the date format dd/mm/yyyy

The issue occur when the user enters a date in English (United Kingdom) that is invalid in English (United States), such as 05/13/2024. 

Solution

There is a hidden LANG querystring parameter containing the user's current browser locale that is passed to every Intelligent Forms form. Use the parameter to convert the date to the appropriate format as per the following example.

CREATE PROCEDURE [dbo].[SaveFilter]
(
       @Lang NVARCHAR(50),
       @ResourceId UNIQUEIDENTIFIER,    
       @StartDate NVARCHAR(MAX),
       @EndDate NVARCHAR(MAX),
       @PostingDate NVARCHAR(MAX)
 
)
AS
 
SET NOCOUNT ON
 
DECLARE @RealStartDate DATETIME
DECLARE @RealEndDate DATETIME
DECLARE @RealPostingDate DATETIME
 
-- Convert dates to US format
EXEC CPX_ConvertDate @Lang, @StartDate, @RealStartDate OUTPUT
EXEC CPX_ConvertDate @Lang, @EndDate, @RealEndDate OUTPUT
EXEC CPX_ConvertDate @Lang, @PostingDate, @RealPostingDate OUTPUT