Articles → LIGHT SWITCH 2011 → Change Date Format Of A Lightswitch Application
Change Date Format Of A Lightswitch Application
Software Requirement
- Visual studio 2010 is installed on your machine.
- Visual Studio 2010 service pack 1 is installed on your machine.
- Microsoft Visual Studio Light switch 2011 is installed on your machine.
Prerequisite Knowledge
- Basics about lightswitch.
- How to create screens in lightswitch?
- How to create tables in lightswitch?
Steps Of Execution
- Create a new project
- Create new tables
- Create new screens
- Add data to the screen
- Add code to change date format
Create A New Project
Click to Enlarge
Create New Tables
Click to Enlarge
Click to Enlarge
Create New Screens
Click to Enlarge
Add Data To The Screen
Click to Enlarge
Add Code To Change Date Format
partial void Application_Initialize() {
Dispatchers.Main.BeginInvoke(() = >{
CultureInfo ci = (CultureInfo) Thread.CurrentThread.CurrentCulture.Clone();
ci.DateTimeFormat.ShortDatePattern = "dd-MMM-yy";
Thread.CurrentThread.CurrentCulture = ci;
});
}
Output
Click to Enlarge