hgs1906 / smartgwt

Automatically exported from code.google.com/p/smartgwt
0 stars 0 forks source link

24h Support in Calendar Widget #460

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'd like to see a 24 hour support in the Calendar Widget. In SmartGWT you
can localize nearly everything but the calendar. 

Could you please provide a TimeFormatter or similar, so I can get rid of
the AM PM times?

It's important to customize the time format.

Original issue reported on code.google.com by freaky-s...@gmx.net on 18 May 2010 at 3:27

GoogleCodeExporter commented 9 years ago

Original comment by sanjiv.j...@gmail.com on 19 May 2010 at 2:59

GoogleCodeExporter commented 9 years ago
Hi, 

Is there any chance, that this issue will be fixed in a near future? 

Original comment by maciej.k...@gmail.com on 25 May 2010 at 11:14

GoogleCodeExporter commented 9 years ago
Hi , we're a french software provider using smartgwt for developing a new 
webmail. We saw a lot of people interested in this feature. Would someone be 
interested in joining us for sharing a  sponsorhip. Do not hesitate to contact 
us.

Original comment by ali...@gmail.com on 21 Jun 2010 at 3:37

GoogleCodeExporter commented 9 years ago
This widget is not useful in europe as long as the column-headers and 
row-titles are not customizable. 
The AM/PM Labels are quite annoying.
It would be quite cool, if the headers were customizable, to use the calendar 
as an timetable or an planning instrument with (dateless-)headers like "Mo", 
"Tue", "We"... or the localized equivalents.

This is really a cool component, but it is sad that it is quite useless outside 
of the english-speaking world, sorry!

Original comment by aucejo...@googlemail.com on 8 Sep 2010 at 1:38

GoogleCodeExporter commented 9 years ago
As a workaround, adjust file ISC_Calendar.js:l.3220-3229 to get European date 
format:

{code}
formatCellValue : function (value, record, rowNum, colNum, grid) {
  if (rowNum % 2 == 0) {
    return (rowNum / 2) + ":00";
  }
  else {
    return "";
  }
}
{code}

Original comment by rroel...@gmail.com on 11 Oct 2010 at 1:41

GoogleCodeExporter commented 9 years ago
I replaced the US only format by formatters at least for the day view (file 
Calendar.js).

Calendar:getEventHoverHTML
[CODE]
dateFormatter:"toEuropeanShortDate",

timeFormatter:"toShort24HourTime",

//> @method calendar.getEventHoverHTML()
// gets the hover html for an event being hovered over. Override here to return 
custom 
// html based upon the parameter event object.
//
// @param   event       (Object)    The event being hovered
// @param   eventWindow  (EventWindow) the event window being hovered
//     
// @visibility calendar
//<
getEventHoverHTML : function (event, eventWindow) {
    var cal = this;

    // format date & times
    var sDate = event[cal.startDateField].toShortDate(this.dateFormatter);
    var sTime = isc.Time.toTime(event[cal.startDateField], this.timeFormatter);
    var eTime = isc.Time.toTime(event[cal.endDateField], this.timeFormatter);

    return sDate + " " + sTime + " - " + eTime
        + "</br></br>"
        + event[cal.nameField] + "</br></br>" 
        + event[cal.descriptionField];       
},
[/CODE]

DaySchedule:initWidget
[CODE]
            formatCellValue : function (value, record, rowNum, colNum, grid) {
                if (rowNum % 2 == 0) {
                    var hour = (rowNum /2);
                    var date = isc.Time.parseInput(hour);
                    return isc.Time.toTime(date, grid.creator.timeFormatter);
                }
                else {
                    return "";
                }
            }
[/CODE]

EventWindow:renderEvent
[CODE]
    renderEvent : function (eTop, eLeft, eWidth, eHeight) {
        var cal = this.calendar, event = this.event;

        if (isc.isA.Number(eWidth) && isc.isA.Number(eHeight)) {
            this.resizeTo(Math.round(eWidth), Math.round(eHeight));
        }
        if (isc.isA.Number(eTop) && isc.isA.Number(eLeft)) {
            this.moveTo(Math.round(eLeft), Math.round(eTop));
        }

        var sTime = isc.Time.toTime(event[cal.startDateField], this.calendar.timeFormatter);
        var eTitle = sTime + " " + event[cal.nameField];

        this.setTitle(eTitle);
        this.bringToFront();
    },
[/CODE]

Could anybody give me a hint from which repository I can check out the 
SmartClient source code? Then I could add a proper patch file.

Original comment by rroel...@gmail.com on 23 Oct 2010 at 9:46

GoogleCodeExporter commented 9 years ago
This feature is really important for our customers... any chance this issue 
will be resolved in next version ?

Original comment by sobolews...@gmail.com on 1 Dec 2010 at 2:45

GoogleCodeExporter commented 9 years ago

Original comment by sanjiv.j...@gmail.com on 3 Dec 2010 at 3:46

GoogleCodeExporter commented 9 years ago
Great, thanks can't wait !

Original comment by bfis...@gmail.com on 3 Dec 2010 at 12:26

GoogleCodeExporter commented 9 years ago
Added support for custom date and time formatters for a Calendar. See 
Calendar.setDateFormatter(..) and Calendar.setTimeFormatter(..). Also added 
sample to showcase : 
com.smartgwt.sample.showcase.client.calendar.CalendarDateTimeFormatSample

Note that the time entry input field in the event editor dialog is still based 
on (min, am/pm) and supporting localizable date / time input fields belongs to 
another subsystem and there are no immediate plans to add support for that. You 
can however customize the event dialog input fields completely and the use 
FormItem.setEditorValueFormatter(..) and setEditorValueParser(..) to implement 
any such behavior yourself.

Original comment by sanjiv.j...@gmail.com on 13 Dec 2010 at 12:45