Home » Eclipse Projects » Eclipse Scout » CalendarField doesn't like the 30 March(Dates around the 30 march don't appear correctly in calendar)
CalendarField doesn't like the 30 March [message #1275092] |
Sat, 22 March 2014 13:37 |
|
Hi Scout Users,
CalendarField works fine for me ...except when I add a CalendarAppointment with date after 29 march, then in the CalendarField (Month view "March")
- < 29 march : the date is highlight (ok)
- 30 march : the date is NOT highlight
- 31 march : 30 march is highlight but not 31 march
- 1st april : 31 march is highlight but not 1st april
...and so on
It's ok for Month view "April" (30 march, 31 march are correctly highlighted, 30 april also ok)
Also no problem with other views "day", "week", "work week"...
(Note, that instead of "Mois", it is written "Mese"...
...you've guess, i'm french )
Regards,
Scout 3.9 with RAP (neither Swing nor SWT) / Linux
|
|
|
Re: CalendarField doesn't like the 30 March [message #1276197 is a reply to message #1275092] |
Mon, 24 March 2014 08:11 |
Matthias Nick Messages: 197 Registered: August 2013 |
Senior Member |
|
|
Hi Didier,
thanks for your question. I did try your usecase with our Widget Demo App:
@Override
protected void execLoadItems(Date minDate, Date maxDate, final Set<ICalendarItem> result) throws ProcessingException {
java.util.Calendar cal = java.util.Calendar.getInstance();
cal.setTime(new Date());
cal.set(java.util.Calendar.DAY_OF_MONTH, 31);
cal.set(java.util.Calendar.MONTH, 2);
cal.set(java.util.Calendar.YEAR, 2014);
System.err.println(cal.getTime());
result.add(new CalendarAppointment(1L, 2L, cal.getTime(), cal.getTime(), true, "March 31", "body", "2AD50A"));
cal.setTime(new Date());
cal.set(java.util.Calendar.DAY_OF_MONTH, 30);
cal.set(java.util.Calendar.MONTH, 2);
cal.set(java.util.Calendar.YEAR, 2014);
System.err.println(cal.getTime());
result.add(new CalendarAppointment(1L, 2L, cal.getTime(), cal.getTime(), true, "March 30", "body", "9EE0AA"));
cal.setTime(new Date());
cal.set(java.util.Calendar.DAY_OF_MONTH, 29);
cal.set(java.util.Calendar.MONTH, 2);
cal.set(java.util.Calendar.YEAR, 2014);
System.err.println(cal.getTime());
result.add(new CalendarAppointment(1L, 2L, cal.getTime(), cal.getTime(), true, "March 29", "body", "9AD5FD"));
}
When launching the Swing UI, I get the following result:
So it seems to work correctly on my side. If you could provide more information, we could try to fix your problem together:
- Is your code different to mine?
- Can you tell me which version of Scout you are using?
Best regards,
Matthias
-
Attachment: calendar.png
(Size: 74.59KB, Downloaded 1332 times)
|
|
|
Re: CalendarField doesn't like the 30 March [message #1276352 is a reply to message #1276197] |
Mon, 24 March 2014 12:50 |
|
Hi Matthias,
Thanks for your help and for your quick answer.
I use Scout 3.9 with only RAP (not with Swing neither SWT). I think that the problem appears with Rap.
I use Calendar in that way :
public class CalendarField extends AbstractCalendarField<CalendarField.Calendar> {
@Order(10.0)
public class Calendar extends AbstractExtensibleCalendar {
@Order(10.0)
public class DefaultItemProvider extends AbstractExtensibleCalendarItemProvider {
@Override
protected void execLoadItemsInBackground(final IClientSession session, final Date minDate, final Date maxDate, final Holder<ICalendarItem[]> resultHolder) throws ProcessingException {
resultHolder.setValue(getMyCalendarItems(minDate, maxDate));
}
}
}
}
public ICalendarItem[] getMyCalendarItems() throws ProcessingException {
final java.util.Calendar cal = java.util.Calendar.getInstance();
final List<ICalendarItem> result = new ArrayList<>();
cal.setTime(new Date());
cal.set(java.util.Calendar.DAY_OF_MONTH, 31);
cal.set(java.util.Calendar.MONTH, 2);
cal.set(java.util.Calendar.YEAR, 2014);
System.err.println(cal.getTime());
result.add(new CalendarAppointment(1L, 2L, cal.getTime(), cal.getTime(), true, "March 31", "body", "2AD50A"));
cal.setTime(new Date());
cal.set(java.util.Calendar.DAY_OF_MONTH, 30);
cal.set(java.util.Calendar.MONTH, 2);
cal.set(java.util.Calendar.YEAR, 2014);
System.err.println(cal.getTime());
result.add(new CalendarAppointment(1L, 2L, cal.getTime(), cal.getTime(), true, "March 30", "body", "9EE0AA"));
cal.setTime(new Date());
cal.set(java.util.Calendar.DAY_OF_MONTH, 29);
cal.set(java.util.Calendar.MONTH, 2);
cal.set(java.util.Calendar.YEAR, 2014);
System.err.println(cal.getTime());
result.add(new CalendarAppointment(1L, 2L, cal.getTime(), cal.getTime(), true, "March 29", "body", "9AD5FD"));
return result.toArray(new ICalendarItem[] {});
}
And the result (see attachement) :
Best regards,
Didier
Scout 3.9 with RAP (neither Swing nor SWT) / Linux
|
|
| | | | | | | | | | | | | | | |
Re: CalendarField doesn't like the 30 March [message #1394469 is a reply to message #1278852] |
Sat, 05 July 2014 10:27 |
Jeremie Bresson Messages: 1252 Registered: October 2011 |
Senior Member |
|
|
Didier LALLEMAND wrote on Fri, 28 March 2014 00:35I've never used gerrit, but I'm going to try .
Contributing a patch is pretty simple.
Prerequisite - You need:
* an eclipse.org account (You have already one to post in this forum)
* to sign the CLA
* an existing bug in Bugzilla that describe what you want to change.
Here a "command line" how-to:
0/ Clone the scout RT repository and checkout the develop branch.
git clone -b develop https://git.eclipse.org/r/scout/org.eclipse.scout.rt
If you use git the first time on your computer, you might need to set your email and your user name in the git settings.
1/ Bring your local clone of the git repository in sync with the remote repository:
(Skip this step if just did step 0).
Fetch all commit form the remote repository (develop branch):
And reset your local branch to the latest commit of the develop branch you just fetched (be careful: all local modifications will get lost)
git reset --hard origin/develop
2/ Edit the property file:
Scout text files are located in the folder:
dir org.eclipse.scout.rt.shared/resources/texts/
For example edit the French file:
org.eclipse.scout.rt.shared/resources/texts/ScoutTexts_fr.properties
If your text contains special chars, be aware that you need to encode them. When you find a wrong or missing translation, a fix is to include this translation in your project translation file (Using the NLS Editor). The best way to have the right encoding is to copy the corresponding line from your project translation file into the scout text file.
3/ commit your change locally (the -a option will automatically stage all modified files).
For your commit message the scout team uses something like:
Bug <bug number>: <bug title>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=<bug number>
You can also indicate what you have changed if the bug title is not explicit enough. If you know how, a good practice is to generate a Gerrit Change-Id line at the end of your commit message.
4/ Push your change to Gerrit
git push ssh://<user>@git.eclipse.org:29418/scout/org.eclipse.scout.rt.git HEAD:refs/for/develop
5/ Post the URL of the change as new Bugzilla comment.
If everything works well, your commit message will contain an URL. Past this URL in Bugzilla:
Change for the develop branch: https://git.eclipse.org/r/<change nr>
6/ Tell someone from the team.
We do not monitor the Gerrit inbox actively. Please tell a commiter (email, phone...). Feel free to use the forum or the dev mailing list to get in touch.
Your patch will be reviewed.
See also our contribution guide for a more detailed explanation.
[Updated on: Sun, 06 July 2014 07:32] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Sep 25 08:32:02 GMT 2024
Powered by FUDForum. Page generated in 0.05015 seconds
|