ASP.NET Calendar - Tutorial - Localization

There are two ways to localize the calendar:

  • Set CultureName property
  • Manually

By default, calendar uses current regional settings.

By specifying culture name

This is the easiest way. Only need to specify the culture name.

<obout:Calendar runat="server" CultureName="en-US"></obout:Calendar>
 

On the right is a list of all available culture names you may use for quick reference.
More details are available at CultureInfo class documentation.

Manually

You can manually override any values by specifying one or more of the following properties.

  • FullMonthNames - Comma delimetered list of full month names.
  • ShortMonthNames - Comma delimetered list of abbreviated month names.
  • FullDayNames - Comma delimetered list of full days of week names.
  • ShortDayNames - Comma delimetered list of abbreviated days of week names.
  • FirstDayOfWeek - Integer value for the first day of week. Value must be 0-7, where 0 is Sunday.
  • DateFormat - Date format for date picker mode. See our tutorial on date format.
  • YearMonthFormat - A year and month format for the title of each month.

Here we let the calendar default to using current regional settings, which, in our case, are "en-US," but override the short day names to be a single letter.

  <obout:Calendar runat="server"
StyleFolder="/calendar/styles/default"
class="claret"> ShortDayNames="S,M,T,W,T,F,S"
</obout:Calendar>

Here we set culture to be "es-ES," but set first day of week to be Wednesday and set short day names in English.

  <obout:Calendar runat="server"
StyleFolder="/calendar/styles/default"
class="claret"> CultureName="es-ES"
class="claret"> FirstDayOfWeek="3"
class="claret"> ShortDayNames="Su,Mo,Tu,We,Th,Fr,Sa"
</obout:Calendar>