Date & Day & Month please help

Hi Scripters,
I have creat a diary book in InDesign CS4.
Probelm: I want to alert the date and day for each time like this. But after the 7 saturday after alert the 8th day is undefined result.
Date     Day
1          Sunday
2          Monday
3          Tuesday
4          Wednesday
5          Thursday
6          Friday
7          Saturday          This is alert fine after the date execute in 8 i want to alert Day "Sunday" but i get it result in "undefined"
Please check my Below JS Code Give your valuable output.
var myMonth= new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var myDay = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var myThirty = new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30");
var myThirtyfirst = new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31");
var myFeb = new Array("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28");
for(i=0; i<myMonth.length; i++){
    if(myMonth[i]=="January"){
        for(j=0; j<=myThirtyfirst.length; j++){
            alert(myThirtyfirst[j]+"|"+myDay[j]);
               // after the 8 day is alert is shown  in undefined; i want to continue after the next month is started in wednesday or some other day please check
    else if(myMonth[i]=="February"){
        for(j=0; j<=myFeb.length; j++){
            alert(myFeb[j]+"|"+myDay[j]);
    else if(myMonth[i]=="March"){
        for(j=0; j<=myThirtyfirst.length; j++){
            alert(myThirtyfirst[j]+"|"+myDay[j]);
Note: Saturday & Sunday will come in one alert. Definitely i am confused little bit think so.
thx
csm_phil

Hi csm_phil,
Another problem in your code is that you're counting one too many in a number of spots. If you're counting from 0, you can only go to length-1 - so
for(j=0; j<=myThirtyfirst.length; j++){
should be.
for(j=0; j<myThirtyfirst.length; j++){
The way I generally code it is, depending on what I am counting: if I count from 0, I use < when comparing the counter to the length; if I start from 1, I use <= when comparing your counter to the length.
Now, independent of that, your code is overly complex - as the other posters already said: at least check out the built-in Date object, or that cool Date library Marc referred us to.
Date and time calculations are very tricky to get right, and lucky for us there is no need to reinvent the wheel!

Similar Messages

  • How to read a file with value of RAW data type? Please help

    Hi Experts,
       I  have a file with RAW data like DE864E48833BFFF1B805001CC4EF4BFA
       I am using GUI_UPLOAD.
       But this FM is throwing error.
       I tried by giving FILETYPE as ASC. The output internal table for this FM contains a field of type c size 32.
       Now it is able to read the file but I want to assign this value to a RAW data type variable.
       This it is unable to do. How to convert the char value to RAW data type?
    Please help!
    Thanks
    Gopal

    Hi,
    The documentation for the function module contains an example for RAW upload.
                begin of itab,
                      raw(255) type x,
                end of itab occurs 0.
               CALL FUNCTION 'GUI_UPLOAD'
               exporting
                  filetype =  'BIN'
                  filename = 'C:\DOWNLOAD.BIN'
               tables
                 data_tab = itab.

  • I lost my iphone4 and replaced it with a 4s. It's been a year since my last sync. Do I set up my phone as "new" or "restore from backup?" Im hoping game center will automatically have a current record of game data...please help or advise.thx

    I lost my iphone4 and replaced it with a 4s. It's been a year since my last sync. Do I set up my phone as "new" or "restore from backup?" Im hoping game center will automatically have a current record of game data...please help or advise.thx

    Restore from backup.

  • I have a case number but have not received my serial number yet after 4 days. Please help.

    I have a case number but have not received my serial number yet after 4 days. Please help.

    Do you know where I go to do contact Adobe directly, please?
    On Tue, May 5, 2015 at 11:06 AM, Barbara B. <[email protected]>

  • My iPhone 5 will not sync with itunes. Icon does no appear in left hand column. Both iTunes and the iPhone are running the most up to date updates. Please help.

    My iPhone 5 will not sync with itunes. Icon does no appear in left hand column. Both iTunes and the iPhone are running the most up to date updates. Please help.

    Is your iPhone connected to your computer using the lightning cable or are you doing WiFi sync?
    Sometimes the iPhone doesn't show up in the side bar if you're using WiFi syncing, if its not working, then be connected to your WiFi on your phone and on your computer (Same network) let me know how it's going, if it doesn't work still. Turn your phone off and on again and put in your pass code then try to sync it (keep your phone unlocked and not in sleep mode) tel me if it appears in the side bar.

  • An app counting minutes and data use. Please help!!!

    An app counting minutes and data use. Please help!!!

    Here's one, there are others in the App store:
    http://itunes.apple.com/us/app/data-usage/id386950560?mt=8
    However, since your carrier is the one that bills you, the only stats that matter are your carrier's. Some carrier's offer apps that provide this info, see if yours does.

  • TS3694 I forgot my password and could not open until it is said "connect to iTunes". I connected to iTunes. for three hours, I restored it. But it is still not restarted. what can I do? I can not use my iPad 3 for three days. Please help me!

    I forgot my password and could not open until it is said "connect to iTunes". I connected to iTunes. for three hours, I restored it. But it is still not restarted. what can I do? I can not use my iPad 3 for three days. Please help me!

    Try and force your iPad into Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.

  • I have trouble setting the trash mailbox behavior. I have set it to delete every month but it has been keeping the trash mails for only about 10 days. Please help.

    I have trouble setting the trash mailbox behavior. I have had it set to delete the messages once a month. But lately it has been deleting my messages every 10 days. I have tried choosing different options to set the trash mailbox behavior but has not been successful. Is there anything I can do? Please help.

    Thanks for that advice @randers4.
    I linked through and submitted my info as a "topic not covered" in the iCloud section. After entering the serial number of my MBP it turns out I wasn't eligible for technical support (though I don't think this is hardware related support) and the final suggestion was to take my computer into an Apple store. I called my local Apple reseller and asked for assistance. The customer service rep was very nice but unable to help, so suggested I call Apple Support on 1300 321 456. I did so and, again, spoke to two very polite and helpful customer service people (I was transferred to security services). I didn't have to be on hold to speak to either rep for more than a few seconds! After trying a few different things, he worked out what was happening...
    So, to cut a long story short, to solve the problem in my OP, all I had to do was log out of iCloud in my System Preferences and log back in using my current Apple ID. [Edited to add that I had to sign out of everything I was currently signed in to with my Apple ID before logging out and in again.]
    Problem solved!
    Message was edited by: NotBaconBits

  • £750 bill from Vodafone as iPhone sent 20GB last month, please help!

    Hi
    I have just received a shock data bill from vodafone. Apparently my iPhone has been using between 500 MB - 1GB a day for the last month.
    I have had the phone for almost 18 months and cannot work out why this has suddenly happened. I have not downloaded a new app or changed my usage at all.
    I checked the phone and it states that it has sent 20.7 GB of data, and received 1.7 since last reset (October).
    I only use the phone for calls, texts, and social networking. I have wifi at home and barely use cellular data.
    I contacted Vodafone as I wish to dispute the bill (I am happy to pay for what I have used, but I cannot see how I have used this!)
    They state that if I can show it is a software issue, they will write off the £750. At first they suggested I send it to them and they would check if it was software or a fault, until they realised it was out of warranty, then they said they can't look at it unless I pay £150.
    They suggested giving apple a call, but I looked on website and to call them will be £25 and I am not sure if it will resolve the issue.
    What can I do? The phone is still on iOS 6.0, I realise the data issue could possibly be resolved by updating, but am reluctant to do this before the phone is checked out (if I can get apple to check it out). For the time being I have restricted all data to wifi.
    Is it likely to be a fault/software issue? I have not sent any files anywhere etc. If I drive to my nearest apple store (at least an hour away) will they look at it/are they likely to help/admit it is software and give me some proof for vodafone?
    Please help!!

    Contact the Apple store directly (or Verizon) as Apple (nor Verizon for that matter) monitor these forums.

  • How to check the records that were inserted in a day?Please Help!

    HI All,
    How to check the records that were insterted in a day in a standard SAP table?
    For example : I want retrieve the records that were added in a day in WLK1 table.
    How do i do this?
    Urgent!! Please help!
    Thanks in advance!
    Sandeep Shenoy

    HI
        Changes to data within a table can be automatically logged. Such automatic logging of changes is called automatic table history. To turn on logging, tickmark the Log Data Changes check box on the Technical Settings screen
    IF THIS IS ALREADY DONE FOR A PARTICULAR TABLE, YOU CAN GET THE RECORD OF CHANGES THAT YOU MADE FOR THAT PARTICULAR TABLE AS EXPLAINED UNDER
    <a href="http://64.233.179.104/search?q=cache:pOdVy55jfAIJ:cma.zdnet.com/book/abap/ch06/ch06.htmHISTORYOFUPDATESINADAYINABAP&hl=en&gl=in&ct=clnk&cd=1">Automatic Table History and Change Documents</a>
    IF ITS HELPFUL PLEASE REWARD POINTS
    REGARDS
    ANOOP

  • My daughter accidentally dumped my iTouch into the tub.  It is ruined.  How can I receive my one time regrant on all the songs I've lost.  There were approximately 80 songs I purchased on iTunes.  They get me through the day!  Please help!

    My daughter accidentally dumped my iTouch into the bath tub.  It is ruined.  How can I receive my one time regrant to get back the 80 plus songs I purchased and downloaded on iTunes?  I'm devastated....please help!  My husband bought me the new iPhone4 for my new Mother's Day gift.  I would like to download all the songs I lost.  Thank you so much!

    You can redownload the songs as many times as you want, the "one time regrant" no longer exists. Make sure you are using the same apple id on both your dead itouch and your iphone 4. On your iphone 4 go to the itunes app > Purchased (may be under more based on your settings) at the top click not on this iphone, click all songs then click the little cloud next to each song you want to redownload. It will prompt you for your id and password and the begin your download

  • Missing inspection data in QA33.Please help

    After GR, Inspection lot was assigned. But unable to proceed to results recording in QE51N.It says "no entries found". And i could see that there was no inspection data in the lot created. i.e in QA33 the Inspection specifications tab has no data and in Insp. lot quantities tab "sample size" field says 0. I don't know where i was wrong. Please help me.
    Also please explain::
    The master data involved for QM in procurement is :
    we have to create :
    - QM view in Material master and Inspection Type as Active
    - catalog to define attributes
    - MIC to define inspection criteria(like a test case)
    - selected set
    - create sampling scheme, sampling procedures, Dynamic Modification Rules to define sampling criteria.
    - Inspection Plan
    Please correct me if i am missing any mandatory master data here.
    Also please explain how are these connected to each other to Start Quality inspection after a GR for a particular material x in plant P.
    Thanks in advance.

    Hi,
    Please check the inspection lot status  ..if its in "CRTD" (Created) status then you need to make it to "REL"(release) before proceeding (like result recording or UD)..
    Check if the Inspection plan with the correct usage is assigned in the plan concerned for GR  (As there are different usages for production,GR from purchase order,stock transfer etc)..Also see if the Inspection plan is released.
    Again the MIC's you created ,please check if they are also active.  Else see if sample size is assigned correctly
    Hope this helps
    Regards
    George

  • HT1430 what shall i do my ipad won't come on and it has been 5 days now, please help...... :'( i really need it to work back . if u have any solution on how i can fix this problem please let me know . thanks alot .

    please help , my ipad won't turn on

    What were you doing when this happened? Is it charged?
    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    Frozen or unresponsive iPad
    Resolve these most common issues:
        •    Display remains black or blank
        •    Touch screen not responding
        •    Application unexpectedly closes or freezes
    http://www.apple.com/support/ipad/assistant/ipad/
    iPad Frozen, not responding, how to fix
    http://appletoolbox.com/2012/07/ipad-frozen-not-responding-how-to-fix/
    iPad Frozen? How to Force Quit an App, Reset or Restart Your iPad
    http://ipadacademy.com/2010/11/ipad-frozen-how-to-force-quit-an-app-reset-or-res tart-your-ipad
    Black or Blank Screen on iPad or iPhone
    http://appletoolbox.com/2012/10/black-or-blank-screen-on-ipad-or-iphone/
    What to Do When Your iPad Won't Turn On
    http://ipad.about.com/od/iPad_Troubleshooting/ss/What-To-Do-When-Your-Ipad-Wo-No t-Turn-On.htm
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/TS3281
    Home button not working or unresponsive, fix
    http://appletoolbox.com/2013/04/home-button-not-working-or-unresponsive-fix/
    Fixing an iPad Home Button
    http://tinyurl.com/om6rd6u
    iPad: Basic troubleshooting
    http://support.apple.com/kb/TS3274
     Cheers, Tom

  • I lost all my data because i reset my mac and i need it back, i created a new account, and i need all my data and documents Please help.

    I Lost all my data because i forgot my password and reset my mac, and i need it all back Please help!!

    What do you mean by "reset my mac"?

  • Internet is not working on cellular data after updating 8.0.2 in iphone 5s , wifi connectivity is fine , but no internet connection error message is start blinking even after cellular data is on , please help .

    I am using iPhone 5s , internet is not working on cellular data even after it is on , wifi is working properly . Please help apple team.

    Hello Mario:
    I'm actually surprised that Apple continues to push out 8.02 without addressing these issues. The problem will only anger more users and certainly finger-poking at Airplane Mode isn't the answer. This is an iOS8 code problem and no amount of 'resetting' is providing a reliable fix/solution that sticks.
    These issues with loss of cell connectivity, apps that have lost functionality, etc., which are all directly associated to the arrival of iOS8, are so widespread in the user community and pervasive within individual iPads that it's clear there are significant fundamental problems with this release. Given the problems are so blatant, it's fair to ask the question of how they got by the Apple validation team.
    What is the status at Apple on rolling out a fully V&V'd version to resolve this?  Respectfully, when it comes to some of my more useful apps, my personal iPad has become a paperweight. The user forums are full of these iOS8 complaints for several weeks and there doesn't seem to be a competent answer from Apple.  Even a "We're aware and we're working on it" would be well received.
    Any hope that you can provide will be appreciated. (I'll be monitoring the thread on my Dell laptop because, well, my iPad is i-Inop!).
    Thanks!

Maybe you are looking for

  • Link colour problem when previewed in IE

    I'm using DW CS4 on a PC. Problem:   I have successfully (thanks to this forum!) changed the colour of some links on my site (two different types) and it works great in all the browsers except for Internet Explorer. The main links throughout my site

  • Problem with Excel 2013, crashing unexpectedly

    I have problem with Office, it's crashing without any specific reason. I can't describe what exactly triggers crashing, but there is lots of copy and pasting on that workstation between excel worksheets. RAM has been tested, Office suite has been rei

  • IPad video app

    I have downloaded a show but I can't figure out how to watch it. I have seen references to a video app but I can't seem to find on. Should it be on my iPad or do I get it from the app store? If so which one because I can't seem to find one there

  • HTML for Mobile

    Hey Gang, I've seen a few retialers adding links to their HTML email promotions saying "To view this on your PDA click here" Which basically takes them to an HTML page designed and developed to fit in a PDS screen. Using device central (great tool in

  • Invalid Response code (401).

    Hello Team, My requirement is to expose a Web Serive in PI for ABAP Proxy. This WS will be called by Webdynpro Java and display the ECC data in the Enterprise Portal. Environment: ECC 6.0 EHP1, PI 7.1 I have created Data type, Message Type and Servic