Calendar compare issue

Hi,
I've been using the Calendar compare function to test if a certain task falls on a certain day. I do this with the following code:
if (theDate.compareTo(inst.getStart()) >= 0 && theDate.compareTo(inst.getEnd()) <= 0) I've set both times to make sure all values below day are set to zero (the prints affirm to this). So I'm basically setting hour, minute and day to 0, and the rest comes in from a set method.
The problem is that the code doesn't accept dates that are equal.
So I've entered two dates in this code:
theDate.getTime() = Thu Feb 19 00:00:00 NZDT 2009
inst.getStart().getTime() = Thu Feb 19 00:00:00 NZDT 2009
Yet it doesn't say that these two dates are equal (result of using the previous check is -1), and print testing the milliseconds shows the slightest of difference:
theDate.getTimeInMillis() = 1234954800 084
inst.getStart().getTimeInMillis() = 1234954800 759
I'm (wrongfully?) assuming these are milliseconds or something, because they do indeed give the same day when converting them back into a normal calendar, but apparently still do enough do distort the compare function..
I've tried using google, but I'm not finding anything (could be due blindness, hoping it's not).
I'd be really thankful of any help,
Sincerely,
Wim

You can set millisecond and day as well. So you could do that. The Calendar is comparing the millisecond value so that's your problem there.
You could also write your own Comparator to only compare the values you want.

Similar Messages

  • IPhone 5, iCloud calendar reminder issue

    When I use the iCloud calendar on my iPhone 5 and make an event with a reminder set to "on time of event", it will sometimes just beep and flash a notice on lock screen for a few seconds and then the notice disappear from lockscreen.
    Sometimes though, everything works as it should and the notice is still there on lockscreen till I unlock the screen (or the event is over).
    All settings in notice center and mail/calendar is correct.
    When I use google calendar it always works!
    The problem was there from iOS 6.0 and is still there after update to 6.1
    I have been in contact with apple support who couldn't find any help at the moment.
    More people seem to have this according to this site: http://forums.imore.com/ios-6/244349-ios-6-calendar-reminder-issues.html

    Update: The problem occurs when I have connected my iCloud acount with calendar enabled on my iMac.
    It's like the iPhone 5 thinks I have seen the notice on my iMac and therefore removes it from the phone.
    This happens even if my iMac is locked/lockscreen.

  • Iphone 4s calendar alert issue

    I tend to put 2 alerts on my calendar events, one for 1 day before and the second one for 1 hour before (or some other on the day of event).  I have noticed that when I put in the first alert for 1 day before and then enter the second alert for 1 hour before and click done they have somehow been reversed, the first alert is now 1 hour before and the second alert is 1 day before.  I have to click them again and change them to the proper order, this usually take about 3 tries to get them to stay as I want them.  I can them save the event and all is good.  I was at the Apple store and the staff duplicated this issue so I know I'm not the only one experiencing this nuissance.  Has anyone else come across this?  I do hope the upcoming update will fix it.

    Update since Genius visit:
    1) Apple is working on an update
    2) There is no awareness at Apple of this calendar alert issue as a bug, hence it is not being addressed/worked on
    3) Solutions offered by Genius have not resolved this issue.
    Solutions offered by Genius, in order of which to try first:
    1) Delete calendar data from iPhone: Settings>iCloud>Calendars OFF and then restore data from iCloud: Calendars ON
    2) Reset iPhone settings: Settings>General>Reset>Reset all settings
    3) Restore to factory settings: Settings>General>Reset>Erase all content and settings, then restore data from iCloud and in-app backups.
    4) Use another calendar app (seriously)
    Of course, if the bug is actually part of the iOS software (could it be?) then no amount of erasing and restoring data will fix the issue.  I completed the first two options with no change, and am not willing to do the third option because I am not interested in going through the process of backing up, then restoring all my third-party apps.
    My solution: raise awareness of this issue with Apple, so that it can be worked on and fixed.   I have reported it as a bug through Apple's feedback module: http://www.apple.com/feedback/iphone.html and I encourage-- no, ask-- you to do the same, if you are experiencing this issue.  I provided a link to this forum topic to show the variety and detail of problems.
    Are you sick of missing alerts, fiddling endlessly, coming up with workarounds, paying for unreliable software, and not being responded to?  I am.  It's time to rally!

  • Blackberry Outlook Calendar Sync Issue

    We recently discovered a outlook calendar sync issue we can add items on the Blackberry and they will show up in Exchange. But you can’t change a calendar item from the Blackberry, e.g. if you create an item on the phone it will show up in Outlook, but if you use the phone to change the date or name of it Outlook will still show the old one.
    We are running BES 4.1
    We are running Exchange 2003
    Exchange and BES are installed and running on different servers
    OS of the server running BES 4.1 is WINDOWS 2003

    Hi, Please do not post duplicate threads.
    see here > http://supportforums.blackberry.com/rim/board/message?board.id=8300&message.id=37254#M37254
    You are posting your message in device threads meaning normal everyday users are going to read it, if you want advice from administrators, please post it in Blackberry Enterprise Server area.
    You also didn't put what full version of BES you are running! If you are running BPS, i will have it moved to the professional area.
    Thankyou
    If your issue is resolved, put a checkmark in the green box that contains the resolution.
    OR
    If it was just/or also really helpful - Give it a Kudos.. Go on Mate.. Help the rest of the clueless blackberry user world find their answer too..
    ~Gday from Down Under~

  • Calendar Consistency Issues

    We've begun seeing some calendar consistency issues on iPad devices. We are using an Exchange 2007 "back end", most of the users are using Outlook in cached mode on their desktop, and many will have another mobile device of one type or another. The consistency issues are appointments appearing in Outlook or being accepted in Outlook and not showing up on the iPad device. Every hardware vendor we've spoken with, including Microsoft, and RIM have emphasized the client/device side and implementing "best practives" such as the following:
    -minimizing number of instances of mail clients running against mailbox
    -minimizing delegates
    -having only 1 person notified of appointment
    -avoiding forwarding appointments
    -deleting changed recurring appt's rather than changing them
    -not accepting appointments from mobile device
    -running Outlook in online as opposed to cached mode where possible
    I'm hoping someone out there has found a "silver bullet" that goes beyond the suggestions we've gotten which are listed above. The problem is our high profile users that have the devices don't want to be told it's their behavior that's causing the problem!!!
    I appreciate in advance any ideas.

    Same thing happening on my iMac.  Can't do much on the computer.

  • Calendar alert issue

    Hi all,
    I've got a minor annoying issue. My wife (iPhone 4 with iOS6) and I (iPhone 5 wiht iOS6) share an apple account. On iCloud, we've got two calendars. The first is called "Calendar" which is there for us to put all of our general home stuff (birthdays, vacations, appts, etc) and is intended for both of us to use. I've got a second calendar called "Dan" which is just for me with a bunch of stuff she doesn't care about.
    Here's the issue. In Calendar, she clicked "Calendars" and deselected the "Dan" under "iCloud Calendars". The only other calendar her Calendar app now shows is our default shared calendar. So, anything I put on the "Dan" calendar no longer shows up... yay! HOWEVER, alerts from my "Dan" calendar still appear on her phone. In other words, if I put an event called "test" on JUST my "Dan" calendar with an alert to go off at 1:00, at that time, BOTH of our phones go off and display alerts. The Event still doesn't show up in her calendar though.
    SO, my question is, how can she make it so alerts from "Dan" calendar don't show up on her phone? It's annoying for her, and not cool for me if I want to put in an event that she shouldn't know about.
    Thanks,
    Dan P.

    Update since Genius visit:
    1) Apple is working on an update
    2) There is no awareness at Apple of this calendar alert issue as a bug, hence it is not being addressed/worked on
    3) Solutions offered by Genius have not resolved this issue.
    Solutions offered by Genius, in order of which to try first:
    1) Delete calendar data from iPhone: Settings>iCloud>Calendars OFF and then restore data from iCloud: Calendars ON
    2) Reset iPhone settings: Settings>General>Reset>Reset all settings
    3) Restore to factory settings: Settings>General>Reset>Erase all content and settings, then restore data from iCloud and in-app backups.
    4) Use another calendar app (seriously)
    Of course, if the bug is actually part of the iOS software (could it be?) then no amount of erasing and restoring data will fix the issue.  I completed the first two options with no change, and am not willing to do the third option because I am not interested in going through the process of backing up, then restoring all my third-party apps.
    My solution: raise awareness of this issue with Apple, so that it can be worked on and fixed.   I have reported it as a bug through Apple's feedback module: http://www.apple.com/feedback/iphone.html and I encourage-- no, ask-- you to do the same, if you are experiencing this issue.  I provided a link to this forum topic to show the variety and detail of problems.
    Are you sick of missing alerts, fiddling endlessly, coming up with workarounds, paying for unreliable software, and not being responded to?  I am.  It's time to rally!

  • Since downloading OS 6 for my iPad, my calendar keeps issuing repeated alerts - even though I didn't even initiate one.  Is there a way to stop this from happening?  Thanks for your input !

    Since downloading OS6 for my iPad, the calendar keeps issuing repeated &amp; different alerts for events even when I initiated none.
    Any suggestions as how to stop this will be most appreciated.
    Thank you in advance !

    This is the same issue that has plagued me for years. I always thought that this was a Flash plugin issue, but it does occur on HTML5 as well. A friend of mine verified that this does not occur in Linux, but only on Windows. It would be great to have this fixed, as it's honestly the only thing that's making me use Chrome all the time, as I don't want to have multiple browsers open.

  • Outlook 2011 and mountain lion calendar sync issues... resolved (kinda)

    Okay... I never really post to these boards, but I'm fairly ticked off that OS X keeps tampering with MS Office and it's syncing with iTunes and, ultimately, my iPhone.  Apple support tried to push me onto the iCloud, but I'm not going to use that crappy feature. After many hours of trying to fix the calendar sync issue with MS Office 2011, I found a workaround:
    1.  Get the apple reminders set up to recognize the OS X Calendar program.
    2.  Confirm that your Outlook calendar data is recognized in the OS X Calendar program (it was always there for me)
    3.  Install MS Office 2008 (Entourage) --- You don't have to use it, but the older program still syncs with Mountain Lion.
    4.  Sync your iphone with itunes and ensure that your Calendars are erased (uncheck the Calendar sync box).
    5.  Click on the "Replace Information on this iPhone) for Calendars.
    6.  Re-sync the iPhone with iTunes.
    7.  The data should go up with no problem.
    IF you are still having problems...
    1.  go to OS X "Calendar" and Add a new calendar called "Home".
    2.  move the Outlook data to the Home calendar (just drag and drop).
    3.  Repeat steps 4-7 above.
    Since I've done these changes, everything directly syncs.
    Hope this helps, and don't lose faith.  MS will come up with some type of patch.

    Outlook 2011 is not compatible with iCloud, it won't work and your 'workaround' may affect iCloud clients on the same account.
    Don't use 2011.

  • Intermittent iphone activesync calendar/mail issues

    We are experiencing intermittent activesync calendar/email issues that are causing many of our iPhone users to miss meetings and have major trouble scheduling events from the iPhone. The main problem is that most of the time everything works perfectly until suddenly you realize that you missed a meeting or that your email is suddenly out of sync and you have no idea how long it has be like that.
    I have found several band aid "solutions" to temporarily resolve the issues:
    http://blog.fosketts.net/2008/07/10/how-to-set-up-iphone-exchange-activesync/
    http://blog.hltechsolutions.com/2008/07/iphone-activesync-calendar_24.html
    We are using iPhone Firmware 3.0 and higher on all iPhones on a Exch 2007 server
    We need a really solution for this ASAP

    I am on version 3.1.2 and am having many problems with ActiveSync. It often says connection to server cannot be established and prompts me for my password multiple times a day. I have checked with other iPhone users in the organization and many do not have problems. I have tried changing my password, deleting the ActiveSync profile and recreating, and restoring the iPhone. I am getting quite frustrated as are my IT peers as they have to unlock my Windows account every few hours. I need help please!
    This behavior seems to have started when I upgraded to 3.1.2. Before that I never had any problems.

  • Calendar sharing issue

    For the first time I am trying to share calendars with my husband. He can see my calendar on his phone and iCloud and I can see my calendar on my phone and iCloud. His calendar can only be seen on his phone. It shows on all four places that his calendar is shared but no info is transferred. I compared the settings on both our phones and as far as I can tell they are identical. I used a different email address for him thinking it might solve the problem. No dice. I feel like I have covered all the bases and it's an issue somewhere with his phone communicating. ICloud doesn't show any of his contacts either. Can someone help me?

    Hi,
    From your description, OWA works well, then the permission is suitable. I recommend you turn off cached mode on Outlook, restart Outlook and check the result. If it works well, then you can re-enable cached mode.
    Hope this can be helpful to you.
    Best regards,
    Amy Wang
    TechNet Community Support

  • Old Netscape Calendar Server Issue

    Greetings All-
    We are still using Netscape Calendar Sever 4.0 on a Windows NT4 server. I have never been able to get the email notification function to work properly. The Calendar Server uses sendmail.exe to send the message to our email server but they never go through. Here is the error I see in the email server logs: Return-Path 'unison' rejected: a domain name must be specified
    It seems the Calendar Server is sending the message using 'unison' as the sender but it gets bounced because it isn't a fully qualified domain name. I've tried a couple different things without success...does anyone have any thoughts or suggestions?
    Thanks!
    Mark

    Hi Shane-
    I appreciate your reply.
    As for an email server, we're running CommuniGate (in case anyone has heard of them) and I've talked with their tech people and there isn't a way that I can configure the mail system to accept the "unison" header without a @domain.com added to it.
    Our email domain info is set in the unison.ini file and unfortunately, the -f switch doesn't work with the version of sendmail that the Calendar Server software installed (dated 1999).
    The interesting thing about this whole deal is that we used to be using Calendar Server 3.5 and the email notification worked fine. I moved us over to version 4.0 because the old Calendar Server resided on an ancient Compaq server that was about to drop dead and I had to get the data off of that machine onto another server. You might ask why I didn't just install version 3.5 on the other server...well, that was installed a number of years ago and the person who took care of that apparently didn't keep the software. No one in the office could find it and one person thought it may have been downloaded from Netscape but not saved.
    So, I found version 4 of sale on eBay and got it for us. Version 4 is slightly different than 3.5 but not by much as far as I can tell. I've compared the ini files between the two and the differences are very slight - mainly smtp-based entries replaced unix-based ones. Other than that, I haven't been able to find anything drastically different.
    We have plans to move to Exchange in the future and will use it's calendaring features but in the meantime, I was interested in trying to find a solution to this issue.
    Thanks again and I appreciate your suggestions.
    Mark

  • Gmail/Exchange email and calendar syncing issues

    I have wiped my email accounts several times and entered in my data in the various ways as shown through the forums but my email accounts do no sync properly whether it is manual or active synced.
    I read my emails in my gmail and my Microsoft exchange account and will delete or file them away but then when I check my accounts on my desktop, they are not synced as I've done so on my phone. I've also noticed that my calendars are not synced correctly either.
    Could someone help me understand why and how these issues can be fixed? I'm in meetings for most of the day so I rely on my phone to keep me mobile. Was this a bad purchase?!?!

    Hi JadeyMU,
    How do you have your Microsoft Exchange account configured on your BlackBerry Z10? Are you using ActiveSync, BlackBerry Enterprise Server (BES), IMAP or POP?
    Thanks.
    -CptS
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Office 2013 Calendar Synchronization Issue

    This is really odd, and has totally stumped me.
    Our client is running a network with both local and remote desktop services, using Office 2010 locally and 2013 in the remote session. One user, before Christmas was not synchronising with a shared calendar, so we created a new user profile, completely separate,
    which fixed the problem for a while. Now the issue has re-occurred, only with this one user, but it has happened on both her profiles.
    The client has a number of shared calendars that users book multiple appointments in, and in testing when an appointment is booked, it shows up instantly on the other users' desktops. Except for this one user, it doesn't show up at all. And appointments
    booked by her don't show on anyone else's version of that calendar. This happens on Office 2013 through the Remote Desktop, on OWA and on the local machines on Office 2010. There doesn't seem to be any corruption in the profile, and this has got me completely
    stumped.
    Help.

    Hi,
    Since the issue exists on both OWA and Outlook Client, I suppose creating a new profile won't work this time, probably an Exchange thing.
    Have the user right click on the shared calendar, go to Properties
    -> Permissions to check what permission she has. Remove and regain the proper permission for her, check if this helps.
    I also suggest you check the her permission on the shared calendar on Exchange side, see if it meets the permisson displayed in Outlook.
    Thanks,
    Melon Chen
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

  • Dots (events) for every single day in calendar (NEW issue)

    Ever since I upgraded to FW 2.0 I have had "dots" appear in every single day of the calendar (symbolizing events) even though I have no events for those days.
    Now - I KNOW about the issue with the recurring/repeating events as well as events that "begin" after they "end." That said, I have checked EVERY single event I have in the phone and in the calendar in Outlook and NONE of the events are repeating/recurring and all of them are set up properly with correct start/end times.
    From my searching, the above seems to be what's commonly known to cause this problem. Those don't fit MY problem.
    The odd thing here is, if I go backward in the month view on the calendar on the phone to February, there are no dots. There are also no events. However, if I go to March on the month view in the calendar, every single day has dots (and continues). The really weird thing here is if you look at the calendar in the month view while it's on March, you can see the last week of February at the top. And in that last week, while in the "March" view, the last week of February ALL has dots. But again, if you move back to "February," all those dots that were there disappear.
    So...I'm at a loss now. I've wiped the events off the phone. Edited/pruned/etc. events in the Outlook calendar, and then re-synced with the order to overwrite that which is on the phone. Still no luck. Is this a glitch that needs to be corrected with new FW? Would a restore help? I just don't really know anymore..
    Thanks,
    John

    I am having the same issue. However, I am syncing my calendar to my work computer and the issue presented itself when I upgraded to Office 2007 from 2003. I have since removed Office '07 and did a restore to my iphone which cleared the issue. Then did a sync again to Office 2003 and the issue re-appeared. Not sure if '07 added something to my calendar that is hidden but it is very frustrating.

  • Help. iPhone 5, calendar sync issues using Outlook. Doesn't work. Does any kind soul have a solution

    At my wits end. iPhone 5, OS 7.1.1, using Outlook as mail, contacts and calendar but unable to find a solution to sync everything. I have my own domain and use a small ISP. It's not an Exchange server account. I've trawled countless forums but to no avail. Can anyone help? Steve. 

    Mavericks doesn't sync contacts or calendar via iTunes anymore. Apple removed 'sync services' so Outlook doesn't have the sync engine to move data between iOS & the Mac. It will still work on iTunes 11 on earlier OS X's.
    On 10.9 you can either use iCloud, setup your own contacts & calendar server (OS X server, Biakal, Owncloud & many others) or you can find another online service to use to sync data, like Google apps.
    There is a 200 page thread on the issue…
    https://discussions.apple.com/thread/5460803?start=0&tstart=0
    There is also a user tip on how to setup Baikal…
    Hosting your own CalDAV and CardDAV server using Baïkal Server
    You should also look for apps that may help like SyncMate http://www.eltima.com or maybe missing sync? http://www.markspace.com/
    <Edited by Host>

Maybe you are looking for

  • DO NOT BUY CREATIVE ZEN TOUCH 2

    I cannot begin to explain the problems I have had with the Zen Touch that I bought 2 Weeks ago. The long and short of it is the original device that I bought, I could not transfer songs to it. Dowmloading the latest Firmware / Drivers / Application e

  • Unable to load a query of type Text [Power BI designer]

    I have spent all day building a PQ query in Power BI Designer that successfully returns data. it takes a while to do it, but it does return data. When I switch to the report tab to try and build some reports I see this: Then after waiting for a few m

  • How do I load an applet in a JSP?

    i have coded an applet in a JSP, the page loads without any errors, but I am not able to view the applet. Any clues? thanks in advance

  • Multiple speakers off single Airport Express

    Dudes, I have an Airport Express (AX) hooked up to my stereo. Is it possible to run multiple speakers off it (using a splitter, or some such thing)so that I can have a little set of speakers in the kitchen as well as the living room? Thanks, JC

  • RECTIFY_GEOMETRY goes into an infinite loop

    I have a situation where running RECTIFY_GEOMETRY on certain geometries causes the process to go into what seems an infinite loop and results in me needing to kill the session to stop it. There is obviously something about the geometry which is incor