EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB18785: Explanation on where the calendar picker in MicroStrategy Web collects the different pieces of information


Community Admin

• Strategy


Article explains where the calendar picker in MicroStrategy Web collects the different pieces of information

When answering a date value prompt in Strategy Web the prompts page contains a calendar picker to help users select a date, as shown below:
 

ka04W000000OeNxQAK_0EM4400000028Z9.jpeg

 
The calendar picker will obey the user and project locale preferences, but it can be confusing on where the different sections of the picker or prompt collect the data locale to be used at render time.
 
The following Strategy Knowledge Base technical note explains how to add a new locale to Strategy Web:
KB31468: Adding a new locale to MicroStrategy Web
In the prompts page, the language used to render the calendar picker is picked from the project / user language preference, as shown below:
 

ka04W000000OeNxQAK_0EM4400000028Yw.jpeg

 
If the preference is set to default, the language is picked from the browser language setting, as shown below:
 

ka04W000000OeNxQAK_0EM4400000028Yy.jpeg

 
In this example, Hungarian has been selected for the language locale, this will render the month name, first day of the week and weekdays letter in the calendar using the Hungarian locale as specified in the message bundle file.
 
For the Hungarian locale, a custom MessagesBundle_hu.properties file has been created and saved under WEB-INF\classes\resources.
 
The month name are found in the file between mstr.1956 and mstr.1967.
 
The weekdays letter are between mstr.1968 and mstr.1974.
 
If Hungarian had been selected but did not have a MessageBundle_(language initials).xml file for it then Strategy Web would have used the default MessageBundle.xml file.
 
The rendered calendar using the Hungarian locale looks as follows:
 

ka04W000000OeNxQAK_0EM4400000028ZG.jpeg

 
When selecting a date from the calendar using javascript we pre-populate the text box in the prompt page.
 
The date put in the text box is formatted according to the project / user preference set in the Number and Date Format locale preference, as shown below:
 

ka04W000000OeNxQAK_0EM4400000028ZD.jpeg

 
Again if the preference is left as default, the one used by the browser is picked.
 
Strategy Web determines the formatting of the date to be entered in the text box by using the date formatting specified in format_config.xml under WEB-INF\xml for the language specified in the "Number and Date Format" locale in the preferences.
 
This example uses:


<locale language="es" country="ES">
 <data-type name="date">
   <out>d/MM/yyyy</out>


  
Notice how only the format specified in the <out> tags is used.
Continuing with this example, the calendar picker is rendered using the Hungarian locale but the prompt value text box is populated with a Spanish date formatting, as shown below:
 

ka04W000000OeNxQAK_0EM4400000028ZB.jpeg

 
When submitting the prompt, Strategy Web and Intelligence Server 8.1.x will check that the correct formatting for the date entered matches the specification date formatting for the locale being used.
 
There are two validation steps:
 

  1. Strategy Web will check that one of the <IN> formats is used as specified in the format_config.xml under WEB-INF\xml for the selected language.
  2. Strategy intelligence Server will also check against his LCID list to make sure the correct format is being used for the selected language.

In Strategy Web, inside format_config.xml administrators can add any formatting they want but if the formatting entered does not match the formatting specified in the LCID list the prompt submission will fail.
 
The following URL contains a list of locales and valid format for Date, Time, currency…:
 
LCID List
If one of the validations fails, Strategy Web will return the following error message:
 

ka04W000000OeNxQAK_0EM4400000028ZE.jpeg

 
Your answer must be a date in the correct date format
In this example, Spanish has been selected as the 'Number and date format.' The LCID list shows the following 'accepted' formats for short dates:
 

  • 23/08/2005
  • dd/MM/yyyy
  • dd/MM/yy
  • d/MM/yy
  • d/M/yy
  • dd-MM-yy
  • dd.MM.yy
  • yyyy-MM-dd

The format_config.xml should be built accordingly:
 


<locale language="es" country="ES">
 <data-type name="date">
   <out>d/MM/yyyy</out>
   <in>d/M/yyyy</in>
   <in>d/M/yy</in>
   <in>d-M-yy</in>
   <in>d.M.yy</in>
   <in>yyyy-M-d</in>


  
Customization Code Warning:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build
 


Comment

0 comments

Details

Knowledge Article

Published:

June 10, 2017

Last Updated:

June 10, 2017