PDA

View Full Version : [CLOSED] ext:CalendarPanel: Time slots should be formated in Portuguese (military time format).



supera
Mar 28, 2012, 12:24 PM
Hi

In CalendarPanel, Time slots should be formated in Portuguese (military time format).

I set the 'Locale' property in ResourceManager as follow:


<ext:ResourceManager ID="ResourceManager1" runat="server" Locale="pt-BR" />


See highlighted 3 in picture bellow:

4020

Daniil
Mar 28, 2012, 2:14 PM
Hi,

Again, needs to override the scripts. The Calendar is not the best in the localization aspect.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET Example</title>

<ext:ResourcePlaceHolder runat="server" Mode="ScriptFiles" />

<script type="text/javascript">
Ext.calendar.template.DayBody.override({
applyTemplate : function(o){
this.today = Ext.calendar.util.Date.today();
this.dayCount = this.dayCount || 1;

var i = 0,
days = [],
dt = Ext.Date.clone(o.viewStart),
times = [];

for(; i<this.dayCount; i++){
days[i] = Ext.calendar.util.Date.add(dt, {days: i});
}

// use a fixed DST-safe date so times don't get skipped on DST boundaries
dt = Ext.Date.clearTime(new Date('5/26/1972'));

for(i=0; i<24; i++){
//times.push(Ext.Date.format(dt, 'ga'));
times.push(Ext.Date.format(dt, 'H:i'));
dt = Ext.calendar.util.Date.add(dt, {hours: 1});
}

return this.applyOut({
days: days,
dayCount: days.length,
times: times
}, []).join('');
}
});
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server" Layout="fit">
<Items>
<ext:CalendarPanel runat="server">
<EventStore runat="server" />
</ext:CalendarPanel>
</Items>
</ext:Viewport>
</body>
</html>

supera
Mar 28, 2012, 2:39 PM
Hi Daniil....

Works very fine... it was perfect...

Thanks a lot.