Problems with GregorianCalendar.add(Calendar.WEEK_OF_YEAR, 1)

hi all
i'm writing an application to calculate all the days of all the week of the year
i got 2 buttons, one to forward to the next week, the other to go back to the last
this is my code:
GregorianCalendar now = new GregorianCalendar();
DateFormat week=new SimpleDateFormat( "w" ); 
private void b_proxActionPerformed(java.awt.event.ActionEvent evt)
//the next week
        now.add(now.WEEK_OF_YEAR, 1);                      
        System.out.println("week "+week.format(now.getTime()));
private void b_precActionPerformed(java.awt.event.ActionEvent evt) {
        now.add(now.WEEK_OF_YEAR, -1);    
         System.out.println("week "+week.format(now.getTime()));
}the problem is that, when i want to skip to the next week i get:
WEEK 25 (the current week)
WEEK 26
WEEK 28
WEEK 30
like i were add 2, but i added 1 to the week value!!!
and when i want to return to the previous week (by pressing the second button), the week number is always the same!!
anyone could help me?
thanx
sandro

Whether it matters or not, just simply stating that it's correct.
Here's my code that worked correctly ...
Calendar time = new GregorianCalendar();
SimpleDateFormat sdf = new SimpleDateFormat("w");
for(int i=0; i < 10; i++)
    System.out.println("week in year: "+time.get(Calendar.WEEK_OF_YEAR));
    System.out.println("Week in year by sdf: "+sdf.format(time.getTime()));
    time.add(Calendar.WEEK_OF_YEAR, 1);
}

Similar Messages

  • Problems with a shared calendar using Outlook 2007 and Exchange 2010

    Hello all,
    We are having a problem with sharing a calendar using Outlook 2007 and Exchange 2010.
    I will start with some background. I have just started my position with this company. I have been working with networks for awhile at the small business level. I have not had much production experience with exchange. There is only myself and my supervisor
    who has inherited a midsized network which was built by five previous techs that are no longer with the company. Of course, the previous techs did not leave much documentation, so the original hows and whys for our system setup has been lost.
    One of the managers has a calendar she shares with some of our users. I believe this calendar has been in use since sometime in 2006. A mailbox was created to hold this calendar to keep it separate from the managers calendar. I am not sure what version
    of exchange they were using at that time, but I assume there was one or two migrations of it getting to its current state on our exchange 2010 server. At some point it was observed that the other workers she was sharing with were not able to access it correctly.
    I am not fully sure what the original problem was (possibly some people not being able to see or connect to the calendar), but it was decided to give everyone who needed access to this calendar full access permissions through exchange. Correct me if I
    am wrong, but I believe that gave everyone connected the ability to do anything with the calendar. Of course the manager was not happy about that. This is where I started working on the problem.
    I removed everyone, except the manager who wants to control the calendar, from having "Full Access Permissions". This did have the effect of making some people just able to see the calendar and not make changes. Though there were others that were
    able to connect to the calendar who I thought would not be able to. The manager that originally created the calendar did try to manage access to it through the Outlook interface, though it currently does not seem to be fully in effect.
    So, to get to the point of what we are trying to do, is there a way to get the original manager back into control of the calendar though Outlook? It would be preferred to be able to keep the history of what they tracked of this calendar, so starting a new
    one would be something we would rather avoid. After that, getting all of the users that need to connect to the calendar reconnected with the correct access permissions and making sure they are all synchronized.
    I realize this is a big mess, and your help would be greatly appreciated.

    Hi Nigel,
    How is the impact, just one user or all users, Outlook or OWA?
    If just one user, it seems like an issue on the Outlook Client side.
    Please trying to re-create new profile to fresh the caches.
    Please runing Outlook under safe mode to avoid some AVs, add-ins and firewall.
    Found a similar thread for your reference:
    Calendar Sharing not available error message
    http://social.technet.microsoft.com/Forums/exchange/en-US/d9b33281-d7bb-4608-8025-16fb26643d0d/calendar-sharing-not-available-error-message?forum=exchangesvrclientslegacy
    Hope it is helpful
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

  • Blackberry Pearl 8130 Synchronizing problems with Outlook 2007 Calendar

    Have NEVER had a problem with synchronizing my calendar - now I get a message
    Unable to get an Outlook or MS Exchange record.  Lack of network access can cause this problem.  Retry and if problem persists refer to online topic How do I get technical support."
    I cannot find anything to help me fix this problem.
    Solved!
    Go to Solution.

    Hmmm...strange indeed...OK, then the next thing I can think of is for you to perform a complete start over with DTM:
    I suggest the following steps (insert plenty of reboots of your PC...not just restarts, but full power down reboots). Also, it is advised that you be logged into the PC on an account with full admin rights. Further, under Vista/Win7, use the "Run As Administrator" option for everything.
    1) Remove your device OS update package from your PC (add/remove programs)
    2) Cleanly uninstall the RIM DTM software:
    KB02206 How to perform a clean uninstall of BlackBerry Desktop Software
    3) Get a fresh download of the RIM DTM software:
    https://www.blackberry.com/Downloads/entry.do?code=A8BAA56554F96369AB93E4F3BB068C22
    Choose the version that is newest and (if applicable) compatible with your PIM (if you are synchornizing via USB):
    KB12268 Applications supported by BlackBerry Desktop Manager for synchronization
    4) Download (to your PC) a fresh copy of your device OS package from your carrier:
    http://na.blackberry.com/eng/support/downloads/download_sites.jsp
    5) Install DTM to your PC
    6) Install (also to your PC), the device OS package
    7) Start the organizer configuration over:
    KB17022 How to configure organizer applications for synchronization using BlackBerry Desktop Manager
    Hopefully that will get things going again.
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Problem with Essbase add-in 9.2.1 and office 2010.

    Hi all,
    we have a problem with Essbase add in 9.2.1 and office 2010.
    Every time when a user opens Excel a new (additionally) euntry in the ad-on menue appears.
    Indeed what happens is, that the add-in is loaded n-times.
    At the first start of excel one time, second two times and so on...
    Thtas's very annoying.
    Can someone confirm this issue or even better know a workaround.
    (A way we have found so far to ease the pain a bit -well only temporary- is to disable the ad-in, close Excel and start it again.
    However with every new start of execel the issues begins again.
    But that's not a solution you can recommand to the end user.)
    Any help is welcome.
    Thank you in advance!
    Andre

    Have a read of the following on Oracle Support - Support for Office 2010 in Essbase Excel Add-In and Smart View [ID 1191235.1]
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • I have problem with this add-one "down them all" , Recently it doesn't show me Size of files !!

    I have problem with this add-one "down them all" , Recently it doesn't show me Size of files !!
    also regular download doesn't show my any thing !! and I can not even resume my files ....
    i know these are direct links and i should be able to resume my downloads any time ( i have this option before )

    If an extension isn't working properly then you need to take this up with its developer.
    *http://www.downthemall.net/

  • When Apple solve problems with new iTunes calendar sync with windows and outlook?

    When Apple solve problems with new iTunes calendar sync with windows and outlook?

    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID
    More Info here...
    Apple ID FAQs  >  http://support.apple.com/kb/HT5622
    If necessary...
    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Strange problems with iCal group calendar

    Hi,
    I got some strange problems with group calendar. They are evil so that we may decide to throw it away because under this cirumstances it's not usable for our company.
    1) If we add events running more than one week in webcalendar, we can see it in the actual week, but not in the following weeks.
    2) The webcalendar seems to be 2 hours in the future, we cannot find how to change time zone or whatever. We can see, that we added a new event at 4pm, in the list of recent changes we see that this event was added at 6pm.
    3) In the Wiki we can see the usernames in the list of recent changes, but in calendar there is only unknown. But there are no anonymous users, only named users within these group.
    Any idea?
    Thanks
    Rene

    If I hadn't been using iCal/Google Calendar for over 18 months, with reminders from both systems playing nicely over that period, I'd happily agree with you. The issue with Reminders only began (for me, at least) in February this year. I agree that there's potential for conflict, and maybe both sets of developers finally threw in the towel. This is a pity, because I like both systems, but I feel slightly irritated at being effectively told by Google or Apple that I have to choose sides.

  • Synchronizing problems with Vista -- Windows Calendar

    Just got my Blackberry Pearl -- am trying to synchronize with my laptop, which is running Vista.
    it synchronizes my contacts and emails just fine, but I can't get it to synchronize with my calendar or tasks.   Anyone else run into this problem?

    This is a major problem for me and has been for the past two months.  I am running Vista with Outlook 2007 and I can't get Intellisync to work.  I have "upgraded" to Desktop 4.3 and still have no ability to sync my Blackberry Pearl with the Outlook Calendar (or anything else in Outlook).  Rogers says that it is a BB Desktop problem related to Vista and they don't know when a fix will be available.  I am resigned to either entering every meeting twice (once in Outlook and then again on the handheld) or tossing out this device and getting something else.
    Has anyone solved a similar problem?

  • Problem with embedded upto calendar

    Just recently, I ran into a problem where my embedded calendar from upto goes over my webpage. It never did this in the past. Is there anything I can do about it? I have a picture of how it looks currently. The url is http://www.griffithhistoricalsociety.org/calendarnewsletters.html

    Hi there,
    This issue was actually the result of a glitch on our end. Everything is now fixed! Thank you for bringing that to our attention. Please don't hesitate to reach out to [email protected] with any additional questions.
    Thanks,
    Jacob
    Jacob Smith
    Director of Business Development | UpTo

  • Problem with an add-on donwloaded

    Hi,
    I have a problem with an application for iPhone.
    I downloaded the application OLD MAGIC and I bought an add-on Old Booth Magic level 1
    After 3 or 4 uses, I lost the add-on and I don't know how I can redownload it.
    Have you got any idea to help me?
    Best regards!
    LEMOINE D.

    Annu wrote:
    So please help me as soon as possible...Hi,
    This is volunteer forum and not place for ASAP questions.
    But, I think your problem has nothing to do with Apex or Oracle product. Contact Microsoft
    Regards,
    Jari

  • Problems with Bamboo add-on

    Hi,
    I use Bamboo the RSS reader add-on to keep track of my feed.
    Sadly I got a Problem with it:
    Bamboo marks some posts which I already marked as read as unread. How can I change it, that Bamboo never does it?

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!

  • Problem with syncing my calendar

    Hi, hope someone can help me
    I am having a problem syncing my blackberry calendar to the PC - the sync  goes so far then blocks, the message on screen is "synchronizing blackberry curve 8520 do not disconnect, organizer data progressing, converting blackberry calendar data". The progress bar is showing green about 3/4 along but nothing else happens.  I have tried resetting the device today and syncing again but the same thing is happening.  Any suggestions please?
    Thanks, Sheila

    you must check your connection or check your cable until can finish the sync

  • Problem with EPM Add-in

    Hello All,
    We are using SAP BPC MS 10 and we are getting problem with Excel retrieve.
    For dynamic reports, it is not possible de retrieve data, even if we can see these data in the database.
    When we refresh the report, it shows a blank page.
    It worked good before, and didn't change any configuration.
    Someone have an idea about this strange behavior?
    Thank you in advance for your help.
    Kind Regards,
    Wafa

    Hello All,
    As we opened an SAP case, we have now the response.
    It seems to be a bug related to some MS component used in BPC.
    There is some hidden character for 3 fact tables. The correction will be integrated in the SP14.
    The workaround is to run the following SQL query (the problem occurs withe some entities):
    UPDATE [dbo].[TblFactCONSOLIDATION]  SET ACCOUNT = RTRIM(ACCOUNT)
    where ENTITY =N'XXXX'
    The problem is now resolved, we are waiting for the SP14 to have a definitive solution.
    Thanks for all!
    Kind Regards,
    Wafa

  • Problem with Outlook Sync/Calendar after upgrade to 10.2

    I have come up with a number of issues which may all be related.
    The core seems to be around the way that my Calendar and contacts are now configured.
    Firstly - I use BBLink to Sync. After the upgrade my 1.1.1 version of BBlink wouldn't sync to Outlook. Its there in BBlink, but greyed out. I updated the BBLink to the latest version. Same problem; there but greyed out.
    Next issue is that I created a new calendar event on the Z10. This all went well until I went to add a person - it asks me to associate an email account to send the notification. If I do this it gives me Local Calendar and which I set to one of my email accounts. Then It displays the name of the computer I sync with.no matter what I do (none, or an email address) it wont accept either giving me an are you sure message and reassigning if I use the same email address OR if I select none it just doesn't do anything and whe I go to save it goes through the same process again.
    If I look under setting>accounts I see BBLink is the source of my Calendar and Events (correct).
    HELP!

    Hi sreffold
    Try updating the BlackBerry version Link to v1.2.0.28 PC o Mac
    With this new version you can make the contact and calendar synchronization. The version 1.1 does not allow the synchronization.
    BBM Channels  PIN: C0007093A
    Do not forget to give LIKE    Those people who help you and advise you about your doubts.  if the review has been SOLVED** # 4LL  #ÉliteRoad  Make a backup of your BlackBerry
    BlackBerry Protect and  BlackBerry Link constantly.  #ichooseBlackBerry10 Gutijose14 Forums Veteran I

  • Problem with Outlook2010 icloud calendars sync

    Hi,
    I use Outlook2010 and icloud and I have the problem that I can only add 14 individual calendars in Outlook with which icloud syncronisation functionates properly. When I want to add a 15th calendar then Outlook doesn't add the calendar to //icloud anymore. Is it possible to solve this problem?
    thank you

    has nobody an answer?

Maybe you are looking for

  • Playing iPod Video through the TV

    I recently purchased the AV Connection Kit. I set it up and successfully played videos and sound from my iPod through the TV. However, when I try to play regular music I do not get any sound. Since the sound from my videos plays, why not normal music

  • Creating a New Email address policy for users in another Domain with Exchange 2013 powershell?

    Hi Everyone Is it possible to create a new-emailaddress policy with Exchange 2013 Powershell, for users within OU´s located on another different domain/forest than where Exchange 2013 is installed? There is a Transitive, two way trust between the dom

  • Send a back bean to another jsf

    Hi to everyone, can anyone tell me, how i can send a back bean of a jsf page to another jsf page. For example JSF1 send his to bean to JSF2. It's like a session variable? Thanxs, Fabio

  • Printer wont print, not sure why.   New to Mac

    Hey Guys, I installed my printer more easily then anything I have ever installed it on before. I was almost worried because the mac effortlessly found and installed it. I tried to print something today and the other day however and it just doest prin

  • EM : Status Pending Since 10.04.2005 0:00:00

    Hi, Why after configuring EM for one database with EMCA and connecting by sys as sysdba I see on first page: Status Pending Since 10.04.2005 0:00:00 instead of Status Up Since Time Zone Availability (%) Instance Name Version Oracle Home Listener Host