Calendar trouble

hi there,
I have an irritating problem with the Calendar class :
Since I work on a french calendar (first day of week is monday and first week of year is the first full week within that year), i wrote :
Calendar c = Calendar.getInstance();
c.setFirstDayOfWeek(Calendar.MONDAY);
c.setMinimalDaysInFirstWeek(7);
// set the date as the last day of year 2004 that counts 53 weeks (in the french style)
c.set(2004, Calendar.DECEMBER, 31);
System.out.println("week of year = "+c.get(Calendar.WEEK_OF_YEAR));
System.out.println("max weeks = "+c.getMaximum(Calendar.WEEK_OF_YEAR));Expected output is :
week of year = 53
max weeks = 53
But I get :
week of year = 52
max weeks = 53
Any idea?
Thanks :)

Well thats because WEEK_OF_YEAR is 0 based.
Alot of people fall for that one... somehow sun descided that the first week is week 0 instead of weak 1.
just as they made the first month 0 instead of 1
Lima

Similar Messages

  • Calendar - Trouble printing in list view

    I want to print all events and items on each of my calendars (so that ultimately I can combine them into one and know that whatever should be there, is).
    I’m in list view, but the print option seems to stick or hang when it gets to ‘Calculating layout…’  The Calendar app remains open.  (It hasn’t crashed or frozen.)
    How do I fix this?  Also, is there a maximum limit as to the date range to insert as an option?  (I’ve tried narrow ranges but this hasn’t yet worked, either.)
    Thank you!

    I have not understood why this problem was occurring, but I have found a solution which is to force the calendar entries to be reset from Mobile Me. I did this:
    1 Did a backup in iTunes in case it went horribly wrong.
    2 Went into iphone>settings>Mail Contacts Calendars > (Mobile Me Account) > Switched off calendars - told it to delete entries on iphone.
    3 Turned off iphone
    4 Waited a bit
    5 Turned iphone on
    6 Repeated 2 and switched on calendars.
    7 Waited a bit for Mobile Me to sync
    All calendars restored nicely..
    Why this problem occurred in the first place is a mystery. Unlike other punters, I didn't have itunes syncing my calendars to iphone, only Mobile Me........... It has the strong smell of a bug as this problem emerged after many months of trouble free syncing only when I updated to iphone 3.

  • Entourage/Calendar trouble

    Also having trouble syncing my calendar. I use entourage. The items will show up in my ical; but are not syncing to my iphone. In fact, none of the new events I've entered on my ical are syncing. I have reset my settings, reloaded software, and don't know what to do next. Otherwise, all of my information appears to be syncing just fine. Any help appreciated. Thanks.

    ECSMCG,
    You may want to try some of the troubleshooting steps in this article:
    http://docs.info.apple.com/article.html?artnum=306113
    Also, verify that you have enabled Entourage syncing by checking the steps in this article:
    http://docs.info.apple.com/article.html?artnum=305938
    Hope this helps,
    Jennifer B.

  • IMac Lion and iPad Cloud calendar troubles

    Which calendar is the master? I input an appointment with correct data on my iPad calendar. It did not show up on my iMac calendar hours later, so I put the complete info on the iMac (Lion, of course) calendar. It then appeared on the iPad as "new event" with no other data. Converse also happened. I put an appointment with person's name and time on my iMac calendar and it appeared on the iPad as "new event" without the specifics. I have been using the cloud for a few months without problems, and had used MobileMe from the beginning. Help!

    Peggy,
    The "Master" calendar lives in the cloud.
    Try using iCloud: Troubleshooting iCloud Calendar to help solve your problem.

  • HT1386 Synching calendars trouble

    Though it has done so in the past, my iPhone (3GS) calendars are no longer synching with my MacBook Pro (OS10.6.8). Set to do it automatically but not doing it even manually. Using iTunes and not the Cloud. Help?

    You can't delete Apple ID's. There is no way to do that. Just abandon it - don't use it any more that's all. If you entered credit card information into the second ID, you might want to remove that information from the account.
    Are you sure that you are signed into the same account in iTunes on your computer that you are using for the iPad? If you are logged into one ID on the iPad and signed into another ID in iTunes on the computer, you will not be able to transfer those purchases.

  • Calendar not working AT ALL

    to start, I had first set up ical server and everything was working fine, I got all the delegates and shares up and working. it kept that way for a few days, then one day after I updated, everything went wrong. the server wouldn't connect to anything... even itself.
    everything else works fine though. so I deleted the delegates and tried a test user account, and that didn't work either, wouldn't connect, and even the local calendars are gone now too. ical won't let me doing anything, except try to add things or connect, and it refuses, I have no idea what's going on. I am a long time mac user and have never dealt with a server before. I set this up for the small business I work for, my main thing is graphic design, though I do dabble in technical issues here and there, so I was appointed most suited for the task, but now I am chest deep in calendar trouble and have other work I need to do. please save me.
    thanks,
    Trent

    I can connect using the .local,
    but I don't know why it would have changed, another guy here did something
    and I don't know what he did and that was around the time this all started happening, but he doesnt even know what he did. but the .local works, just not the .com
    but it used to work for the workgroup and the calendar, now I have to use .local for both.
    any idea what he could have done?

  • I am trying to share calendars with my husband (using Google calendars). He can see my calendars, but I am having trouble seeing his. We both use iPhones.

    I am trying to share calendars with my husband (using Google calendars). He can see my calendars, but I am having trouble seeing his. We both use iPhones. We both have company email addresses. I have had to install and uninstall my gmail info on my iPhone multiple times due to errors sending and receiving emails from my company email address on my phone. For some reason, all of my emails are getting stuck in my outbox when my gmail account is installed on my phone. When I delete it, my emails get sent automatically. This is really annoying! I would do without the gmail account, but I need to share calendars with my husband. How do I fix this?

    If you have two-step verification turned on in your email account, you'll have to log in with a browser and turn it off.

  • TS2776 having trouble syncing google calendar.  If I add event to my calendar using my ipad mini, it won't appear on my google calendar when Im viewing it using my computer or phone.  However, if I post an event using my phone or computer, it appears on i

    Im having trouble syncing google calendar.  If I add event to my calendar using my ipad mini, it won't appear on my google calendar when Im viewing it using my computer or phone.  However, if I post an event using my phone or computer, it appears on ipad mini, why is this and how do I fix it to where everything syncs both ways?

    let me ellaborate on this part:
    "b) perhaps I've got some kind of virus on mine?"
    I mean, " perhaps I've got some kind of virus on mine, and I've passed it on to hers?"

  • Trouble Syncing Tour with my contacts and Calendar

    I have a tour and have had a great deal of trouble with syncing my calendar and my contact from my pc into the BB.  I keep getting error messages during the sync after it has processed some records.  When I try to import my Calendar from Windows mail I get an error. This is a copy of the log:
    On 6/5/2010 3:09 PM
    One-way sync from ASCII Importer/Exporter Calendar to Device Calendar
    First System:             Device
    Second System:            ASCII Importer/Exporter
    Second System File Name:  C:\Users\Decker\Documents\Calendars\Decker Family Calander.ics
    Conflict Resolution:      ASCII Importer/Exporter Wins
    Appointment Range:        From 6/5/2010 To 12/31/2400
    Input From First System:
       READ "Arts festival"
       READ "Florida"
       READ "French trip meeting."
       READ "Sam to france"
       READ "Obx"
       READ "CW Swim sign up indian trail"
       READ "Andy party."
       READ "Andy band camp"
       READ "Andy percussion"
       READ "Gerry z birthday"
       READ "Booster meeting 730"
       READ "Dentist"
       READ "School starts"
       READ "John dukes b day"
       READ "Ipps"
       READ "Anniversary"
       READ "Home grove city"
       READ "Est charles away"
       READ "Away westerville"
       READ "Away circle ville"
       READ "Home fair field"
       READ "Winchester classic"
       READ "Logan elm contest"
       READ "Andy bday"
       READ "Van to Ray."
       READ "Memorial Day weekend"
       READ "Kentucky talk"
       READ "Bens grad party"
       READ "Cw boosters"
       READ "Cw boosters"
       READ "Cw boosters"
       READ "Cw boosters"
       READ "Cw boosters"
       READ "Cw boosters"
       READ "Cw boosters"
       READ "Cw boosters"
       READ "Cw budget meeting"
       READ "PlantHaven dinner"
       READ "PlantHaven open house"
       READ "Texas float trip."
    Total Inputs From First System:  40
    Total Inputs From Second System:  0
    Field mapping used for translation:
       ASCII Importer/Exporter           Device
       Description Title --------------- Description Title
       Notes --------------------------- Notes
       Location ------------------------ Location
       Alarm Date ---------------------- Alarm Date
       Alarm Time ---------------------- Alarm Time
       Start Date ---------------------- Start Date
       Start Time ---------------------- Start Time
       End Date ------------------------ End Date
       End Time ------------------------ End Time
       Alarm Flag ---------------------- Alarm Flag
       Free Busy ----------------------- Free Busy
       Private ------------------------- Private
    Unable to initialize application API.
    Verify that correct application version is installed.
    Translation Canceled!
    Can you suggest any solutions?
    Thank you.

    Thanks for your reply.  First, I am using BB Desktop Manager 5.0.   I set up the sync parameters and had problems.  I tried to sync only the calendar after consolidating several family calendars into one ICS file.  I selected this file but still had the problems noted in the log.  This is similar to the problems I had when I tried to import my contacts into my BB.  In order to avoid duplicates I had to sync one way to the device.  I would only get so far and it would kick out.
    My email sever is from our company.  I am unsure how to find the answer to that question.

  • HT4623 I have updated to ios7 and am having trouble adding appointments to my calendars??

    I am having trouble adding appointments to my various calendars. No probems before ios7 update. What am I doing wrong??

    iPhone 3G IOS 4.2.1 is the latest & greatest. There's no more updates for this iPhone.
    You have to buy a new iPhone since most apps target IOS 6 & IOS 7.

  • HT4258 Trouble making a calendar in iPhoto

    If this has been asked before, I'm sorry.  I'm new to Apple and I'm having trouble!!  I'm trying to make a calendar and I have 4 months left to go.  Everytime I drag and click my photo to the spot it bounces back.  What am I doing wrong???

    drag them to the spot they bounce back
    By spot what do you mean?  The picture part of the month or a date box?
    Happy Holidays

  • Has anyone started having trouble with google calendar syncing / showing up on their iPhone 4s or iPad? As of today my google calendar not longer appears on either device.

    Has anyone started having trouble with google calendar syncing / showing up on their iPhone 4s or iPad 2? As of today it no longer shows up. Thanks.

    Let me re-qualify my issue. Under my Google Calendar account I have the main calendar I originally set up when setting up my account. I then set up several other calendars under this same account such as events, work, family and so on. All the calendars showed up on my iPhone and iPad with no problem and worked great for a year and a half now until yesterday. My main calendar does still show up but the others no longer appear on my devices. Going on line to look at my Google calendar/calendars everything is fine with all of them. Any thoughts as to why they no longer show up on my iPhone or iPad? Thanks again.   

  • I'm having trouble with calendars in mavericks

    I'm having trouble with calendars in mavericks, its sluggis and the rainbow wheel of death comes up also. somebody help please

    When you next have the problem, note the exact time: hour, minute, second.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Scroll back in the log to the time you noted above. Select any messages timestamped from then until the end of the episode, or until they start to repeat, whichever comes first. Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Trouble with calendar and events populating phone

    I am having a significant amount of trouble with getting my phone to populate my calendar and my events.  I have had trouble with this since I got my phone at the end of April and I am getting tired of it.  If i put new calendar entries in on my local calender or I sync from my active sync calender, the result is the same - nothing will show.  The strange thing is is that the reminders will open up, everything is invisible to me.  I've reinstalled the software and have been through the settings on my calender accounts.  I am a business person and this is very important to me and I am starting to get frustrated with this. 
    Any help would be greatly appreciated!

    Ok, I finally figured it out or better I finally got it to work after playing with it. For those who have the same issues I will give you the steps I have taken. It might sound a bit senseless but I didn't know what I was doing might actually make it work.
    Anyways, I read somewhere that in order to be able to set a default Calendar in Settings they added a CalDAV account. I didn't have one but I do have a gmail account. Before adding that I tried again turning on and off the iCloud calendar which didn't help.
    Then I went to the ical app on the iphone and added a new calendar which I called the same as my main one on the iCloud site (HomeCloud). I rebooted the phone every time I made a change. But didn't help either.
    Then I deleted my iCloud account on the iphone reboooted and added it again, rebooted. Now the "Calendars" calendar was not on the iphone anymore but I could see my main HomeCloud, my UK Holiday and the gmail account calendar but nothing was synced.
    Last step I tethered the iphone to my imac and synced via iTunes again and voila I could see everything synced correctly. Last thing I had to uncheck the gmail calendar on the iphone because it was set as the default and now the events I put in the iphone sync correctly with the iCloud site and my icals on my machines.
    I hope this will help whoever has the same issue.

  • I have trouble syncing my exchange calendar and contacts on my mac. Can anyone help please?

    I have trouble syncing my exchange calendar and contacts on my mac. They will initially load up but will not sync back and forth and stay up to date. Can anyone help please?

    I forgot to add my iPhone and iPad work seamlessly with these two topics but my iMac and my Macbook Air don't.

Maybe you are looking for