Help please! How would i know if a day is within a range of dates?

Hi everyone!
I'm new to java. I just want to ask for help about date manipulation.
My situation is this:
In a given company, they set their own first-day-of-the-week. And this first-day-of-the-week may change from time to time. Given a calendar, you will pick a date and automatically, the start and end date of that certain week should be displayed in the text field. But the start and the end week should conform to what they set as the first-day-of-the week.
Example:
first_day_of_the_week = tuesday
picked_date = april 7, 2005 //which is a thursday
the output should be:
start_date = april 5, 2005 //a tuesday
end_date = april 11, 2005 // a monday
because april 7 is within the week april 5 to april 11, april 5 being the first day of that week.
I would really appreaciate if someone could help me.
Thank you in advance!

>
Example:
first_day_of_the_week = tuesday
picked_date = april 7, 2005 //which is a
thursday
the output should be:
start_date = april 5, 2005 //a tuesday
end_date = april 11, 2005 // a monday
because april 7 is within the week april 5 to april
11, april 5 being the first day of that week.
I would really appreaciate if someone could help me.
Thank you in advance!Algorithm...
- Set 'start' = to picked_date
- Use Calendar and 'picked_date' to decrement by one day until day of week is tuesday.
- Set 'start' to date in Calendar.
- Use Calendar and ''picked_date'' to increment by one day until day of week is tuesday.
- Decrement by one.
- Set 'end' to date in Calendar.

Similar Messages

  • I downloaded an upgrade to my adobe reader today, and ever since my search engine has switched to yahoo and wont change back to google. I have a macbook pro, help please? Does anyone know how I can change this back? I have tried through my settings but it

    I downloaded an upgrade to my adobe reader today, and ever since my search engine has switched to yahoo and wont change back to google. I have a macbook pro, help please? Does anyone know how I can change this back? I have tried through my settings but it doesnt work

    Hi Timia,
    If you are using Safari as a web browser :-
    Open Safari, go to Safari menu > Preferences > General, and put Google as the homepage. Then, choose Google as your default search engine.
    If you are using Google Chrome as the web browser :-
      Open Google Chrome.
      In the top right corner of the page, click the Chrome menu Chrome menu > Settings.
      In the "Search" section, select Google from the drop-down menu.
    Let me know if you still experience any issue.
    Regards,
    Aadesh

  • What is the print program for adobe form MEDRUCK_PO, How would I know that?

    Hello All,
    I am new to ADOBE forms and I have a requirement to develop a new Purchase Order Adobe Form . I need to confidure output types too. I am copying 'NEU' to 'ZNEU', and form name 'MEDRUCK_PO' to 'ZMEDRUCK_PO', but what would be the program name and form routine? How would I know the program name and form routine for new output type/form combination.
    Any kind of help is highly appreciated and rewarded.
    Thanks in advance
    Abaper

    I am working on exactly same thing - customizing pdf form MEDRUCK_PO.
    I copied MEDRUCK_PO to Z_MEDRUCK_PO and put my changes into the form.
    You will use transaction SPRO to display the current routine and form and put your changes into effect.
    SPRO-> click tab SAP Reference Image->Material Management->Purchasing->Messages->Forms(Layout Sets) for Messages->Assign Form and Output program for Purchase Order.
    In the Form column change the form name to yours - Z_MEDRUCK_PO for example. You can also change the routine name if you want.
    Take a look at SAPFM06P, specifically at includes FM06PE03 and FM06PE04.
    You will find routines adobe_entry_neu, adobe_entry_mahn and adobe_entry_aufb in FM06PE03. They call routine adobe_print_output located in FM06PE04.

  • How would I know if any one post a thread in the Forum

    Hi All,
    Please tell me how would I know if any body post a thread in the  forum??
    Regards
    krishhna

    Hi,
    I just read the "Suggestions and comments" forum and I found out that you did create a thread called "How would I know if any one post a thread in the Forum ".... So I knew that some one had posted a thread in the forum...
    Regards,
    Oliivier

  • How would i know if a certain screen contains a screen-exit?

    The requirement is to add textfield and a checkbox in the additional data tab in standard transaction me21n.
    I already found the screen for that area where i will be adding the textfield and the checkbox.
    The question is, how would i know that that standard screen contains screen-exit?
    Edited by: navi on Apr 18, 2008 10:06 PM

    hi yash
    your answer is quite helpful.
    but is there a way wherein i can trim down the number of hits? like it will just display the screen-exits for MM.
    they are way too many and i don't have the leisure of time.
    pls advice...
    thanks a lot.

  • CUDA-OPEN CL IS ENABLED - How would I know?

    After backing up my working OS, I attempted to try latestSG updates with Mavericks.
    I know, what was I thinking...?
    Mac Pro Early 2009
    32 Gigs Ram
    CUDA Version 5.5.28
    Nvidia GTX 285
    Mavericks
    SGworks ok with native SG - LUTs and masks dont kill playback. Lots of caching.
    Is it using open CL?
    THE QUESTION: HOW WOULD I KNOW IF IT IS?
    How can we check if GPU is being ultilised? Unlike all AE,PP, ME and proper adobe apps, SG doesnt give me any indication of whats going on.  This is rubbish.
    If I grade same clip via Direct link plays back at one fame per second.. 
    Sending a DL'ed grade back to premiere give me no image, just a 'Media Pending Link' - unless I turn off the embedded Lumetri effect.
    Could anyone tell me what CUDA drivers I might roll back to to get this working?
    I mean, it was tested with a specific set of 'current' drivers, right?
    sidenote: After Effects CC also refuses to utilise this card, which is plenty fast for most things.

    Same test with Mountain Lion
    Mac Pro Early 2009
    32 Gigs Ram
    CUDA Version 5.5.28
    Nvidia GTX 285
    Using CUDA in PP, playback was leagues better than Open CL. But still crappy with any sort of mask in play.
    Using Direct Link within Speedgrade with Single Primary layer is great.... but utterly unusuable if you add masks. (who does that eh?)
    Even if you add empty grading/adjustment layers playback also nosedives, so the hope I had of isolating my masks on separate adjustment layers doesnt help, as it makes working in SG terrible.
    You cant really crossfade multiple SG adjustment layers in PP, as  the vignettes need to be the same group as the grade for the transition to act it properly (or nested, but that's not the point of this workflow).
    When you talk about using Nvidia Cuda GPU accelaration not being available for Speedgrade, how does impact on it's use along the whole pipeline? You need to be clear about where Cuda/CL impacts on performace, and not waste everyone's time discovering the grizzly truth. How many posts are reporting the same problems, again and again.
    What if you are outputting your graded edit in Premiere to AME (which also has CUDA/CL options?  If I render SG graded edits in AME from Premiere - using Open CL adds about 50% to the rendering times. 
    Despite having 32gigs of available ram, SG insists on caching to disk - why?
    Admit that the performace using masks is Direct Mode is not ready for production, and stop trying to pretend it is.
    Update the information links on this forum, as many are out of date, or point to previous versions.

  • HT1476 How would I know when does the iPod touch completes charging?

    Since the iPod touch doesn't display a battery percentage, how would I know when the charging is completed? In iOS 6 and earlier there would be a plugged-in icon meaning that the device is charged, but in iOS 7 there is only one icon that can mean both charging or charged.

    Battery icons
    The battery indicator icon in the upper-right corner of the screen shows battery charging status and about how much charge is left in the battery. When connected to a power source, a small lightning icon will appear next to the battery icon:
    If the battery charge is very low, the device may display a black screen with an empty battery icon, indicating that the battery needs to charge for up to ten minutes before you can use the device. If the battery is extremely low on power, the device may display a black screen for up to two minutes before one of the low-battery images appears; continue to charge the unit for at least 30 minutes or until it is fully charged.
    Yes I already saw this article before and this doesn't help ansewering my question. For iOS 6 and earlier, there would be a lightning icon in the battery when it's charging. If it's charged then there would be a plugged-in icon in the battery. However, the lightnight icon besides the battery in iOS 7 stays the same all the time as long as it's plugged into the charger. So I have no idea when does it finishes its charging, as it doesn't even show battery percentage like iPhone does.

  • HT1923 When I try to uninstall iTunes I get a message saying iTunes 64 msi can not be located and I should enter an alternate path. How would I know where it it is? I get the same message when trying to install the update to iTunes 10.6.1.

    When I try to uninstall iTunes I get a message saying iTunes 64 msi can not be located and I should enter an alternate path. How would I know where it it is? I get the same message when trying to install the update to iTunes 10.6.1.

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?

    I have same problem.
    However, I am unable to turn on Assistive Touch.
    At one time I was able to activate it, but it went away and now I cant reactivate.
    What is the solution?

  • Hello .. I need to know please how do I know if some one got the access to my iCloud account and saw my phone contains ? Thanks

    Hello .. I need to know please how do I know if some one got the access to my iCloud account and saw my phone contains ? Thanks

    Ahmed8885 wrote:
    but I was shocked when I log in using my account on my friend iPhone device and I was surprised that I started to receive and see all my photo stream loading to his phone !
    Really? What did you expect was gonna happen when you logged in using YOUR APPLE ID/PASSWORD?
    That's the way things are supposed to work.

  • How would I know that my phone is not fake?

    My iphone4 have a different regulatory logo printed at the back than the usual iPhones here in my country, how would I know that my phone is not fake? i bought it from Thailand but its regolatory logo seems to be 'South Korea'.

    These days it is pretty difficult to spot fake ones. You can always compare your specs to the ones listed on Apple's official iPhone page and see if it matches up.
    A few things fake iPhones can have that real ones dont: FM Radio, Expandable storage, colors other than black or white, Dual-Sim, stylus use (not compatible with a real iPhone), removable battery, lack of wi-fi or bluetooth. And of course if you can't use it in iTunes, that's a giveaway.

  • Lost my phone today, is there a locator on it? If yes or no, how would i know?, Lost my phone today, is there a locator on it? If yes or no, how would i know?

    How would I know if i had a tracker or locator on my phone if i had one? Do all iphones have one?

    If you enabled "Find My iPhone" on the device prior to it being lost, you may be able to track it.  This assumes the device is powered on, has a network connection (Wi-Fi or Cellular data), and has not been restored as new by whomever found it.
    If you did not enable the feature, the only way to locate the device is to physically start looking for it.

  • Hello sir, Hello sir.    Plz clarify me... My frnd have iphone 5s sealed pack. He purchased it from uk..he told me the phone is unlocked..but i have doubt phone is locked or unlocked..plz help me how can i know phn is locked or unlock???

    Hello sir, Hello sir.    Plz clarify me... My frnd have iphone 5s sealed pack. He purchased it from uk..he told me the phone is unlocked..but i have doubt phone is locked or unlocked..plz help me how can i know phn is locked or unlock???

    hellow sir i have iphone 3gs but its unofficely unlock .
    can i update my iphone ?

  • How would i know if my iphone is original?

    how would i know if my iphone 4 is original?

    Plug the SN in here:
    https://selfsolve.apple.com/agreementWarrantyDynamic.do

  • HT4061 how would i know if the iphone is fake or original using the serial #

    how would i know if the iphone is fake or original using the serial #

    Connect it to your computer and see if iTunes recognizes and connects with it.

Maybe you are looking for

  • CMYK settings for font color keep changing in Word

    I am trying to match a particular color of blue in Word. I set the CYMK percentages using the either the sliders or %age boxes in Word, hit OK and then when I open the color setting box, the numbers have changed. Anyone got an idea of what I'm doing

  • Search option for articles..

    Hi, Do we have an option to search for Articles. I could not find it either in the genral search or in the Articles tab. I would prefer to have such an option. (Scenario - I was trying to look  for BPM related articles. neither could i find them in t

  • Is Photoshop CS4 compatible with system Mac OS10.8.2 ?

    Bought a MacBook Pro. 10.8.2 for Xmas. I have Adobe Creative Suite CS4. I migrated from a previous computer. Photoshop will not run. Error: Licensing for this product has stopped working. Error: 150:30. I have been searching online for an answer. I d

  • Can Iphone sync with any other calendar

    Hi I was wondering if the new Iphone 3G is able to sync with any other calendars other than outlook. If there is a program or something. Thanks for the help Tyler

  • Can we connect single Web role to multiple Azure VPN

    We have a one cloud service as Web role and created two Azure Virtual Networks. Now we have to connect this service with both Azure VPNs.So can we add two <VirtualNetworkSite> under the <NetworkConfiguration> node. like below configuration: <NetworkC