The locale/culture determines first day of week, month names, day of week names, time and date format and other properties.
Adjusting individual properties
Individual aspects of the locale can be adjusted separately using the following properties:
-
Time format (12/24 clock for time headers)
-
Header date format (row headers in timesheet mode)
-
First day of week (for CellGroupBy = Week)
-
Loading label text/HTML
-
Time header customization (custom time header HTML)
JavaScript
You can set the locale using locale property. This will affect all displayed date/time fields.
The following locales are predefined. You can also override the predefined locale or define custom locale using DayPilot.Locale.register() method.
-
ca-es
-
cs-cz
-
da-dk
-
de-at
-
de-ch
-
de-de
-
de-lu
-
en-au
-
en-ca
-
en-gb
-
en-us
-
es-es
-
es-mx
-
eu-es
-
fi-fi
-
fr-be
-
fr-ch
-
fr-fr
-
fr-lu
-
gl-es
-
it-it
-
it-ch
-
ja-jp
-
nb-no
-
nl-nl
-
nl-be
-
nn-no
-
pt-br
-
pl-pl
-
pt-pt
-
ru-ru
-
sk-sk
-
sv-se
-
uk-ua
-
zh-cn
-
zh-tw
Example:
dp.locale = "de-de";
dp.update();
See also:
ASP.NET WebForms
DayPilot will adjust its appearance automatically depending on the Culture set for the current thread.
The Culture can be set at one of the following places:
1. In web.config, configuration/system.web/globalization element, culture attribute.
<configuration>
<system.web>
<globalization culture="en-US"/>
</system.web>
</configuration>
2. In aspx page header:
<%@ Page Culture="en-US" %>
3. In the code behind:
protected void Page_Load(object sender, EventArgs e)
{
Culture = new CultureInfo("da-DK");
}
ASP.NET MVC
DayPilot will adjust its appearance automatically depending on the Culture set for the current thread.
The Culture can be set at one of the following places:
1. In web.config, configuration/system.web/globalization element, culture attribute.
<configuration>
<system.web>
<globalization culture="en-US"/>
</system.web>
</configuration>
2. Use Application_BeginRequest in Global.asax.cs
protected void Application_BeginRequest(Object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-us");
}