PDF Acroform Javascript (WIN): Calculate Next Tuesday Date

06/03/10
Greetings;
I found a javascript that will calculate next Tuesday's date, but I can't seem to get it to work in Acrobat Pro v8 (Acroforms).
Any assistance/guidance you can provide is most appreciated.
Script:
http://christian.lassem.com/js/javascript-next-tuesday/
Javascript for finding Next Tuesday?
function find_date_of_next_tuesday(){
   var today=new Date();
   today.setDate(today.getDate()+1);
   while (today.getDay()!=2){
      today.setDate(today.getDate()+1);
   return (today.toDateString());
Thanks in advance.

You just need to call this function and then use the string it returns. What
is not working, exactly?

Similar Messages

  • Pdf arrives as win.dat files on iphone and ipad

    Pdf arrives as win.dat files on iphone and ipad.   When i send from my pc using outlook 

    You are probably sending the email in rich text format with attachments (http://support.apple.com/kb/TS1506)
    - either try sending it in a different format, or try one of the apps from the app store that support winmail.dat

  • How to get the next working date?

    Hi,
    I need to extract data between the 2nd of the month, and second working date of the following month.
    Here is the code I have to check if the date is a weekend, and check if it is in the Holidays table (for UK Holidays):
    (This code is to check against Easter 2014, so Good Friday was on the 18th of April, Easter Monday was on the 21st, and the date I want returned is Tuesday the 22nd but I cannot get it working correctly).
    declare @LatestDate datetime
    set @LatestDate = DATEADD(m,-9,getdate()) -- cast('01/11/2014' as datetime) --dateadd(m,1,datediff(d,0,'01/11/2014'))
    set @LatestDate = DATEADD(d,13,@LatestDate)
    print @LatestDate
    if datepart(dw,@LatestDate) in (1,7)
    Begin
    while datepart(dw,@LatestDate) in (1,7)
    OR
    exists (select * from Hermes_Rep..Holidays where Holiday =right(CONVERT(CHAR(10), @LatestDate, 101),4) + '-' + left(CONVERT(CHAR(15), @LatestDate, 101),2) + '-' + SUBSTRING(CONVERT(CHAR(15), @LatestDate, 101),4,2))
    Begin
    set @LatestDate=DATEADD(d,1,@LatestDate)
    End
    End
    What I need is for my code to always return the 2nd working day of any month, taking into account weekends, and Holidays in the Holidays table.
    The Holidays table has dates in the format '2014-04-18 00:00:00' (for Good Friday 2014)

    Please follow basic Netiquette and post the DDL we need to answer this. Follow industry and ANSI-ISO standards in your data. You should follow ISO-11179 rules for naming data elements. You should follow ISO-8601 rules for displaying temporal data. We need
    to know the data types, keys and constraints on the table. Avoid dialect in favor of ANSI-ISO Standard SQL. And you need to read and download the PDF for: 
    https:--www.simple-talk.com-books-sql-books-119-sql-code-smells-
    >>Here is the code I have to check if the date is a weekend, and check if it is in the Holidays table (for UK Holidays): <<
    Do you know what a calendar table is?
    >> (This code is to check against Easter 2014, so Good Friday was on the 18th of April, Easter Monday was on the 21st, and the date I want returned is Tuesday the 22nd but I cannot get it working correctly). <<
    Catholic or Orthodox Easter?  This is one of many reasons we do not use computations in SQL. What you did is the wrong approach  done with bad programming. For example, we do not use the old Sybase getdate() now. The only display format allowed in
    ANSI/ISO Standard SQL, but you used a local dialect! 
    COBOL treats dates as strings like you did; SQL has a temporal data type. 
    >> What I need is for my code to always return the 2nd working day of any month, taking into account weekends, and Holidays in the Holidays table. <<
    The idea of a Holiday table is bad; why are these dates totally different entities from other dates? Would you split Personnel on sex and have “Male_Personnel” and “Female_Personnel”? 
    The Julian business day is a good trick. Number the days from whenever your calendar starts and repeat a number for a weekend or company holiday.
    CREATE TABLE Calendar
    (cal_date DATE NOT NULL PRIMARY KEY, 
     julian_business_nbr INTEGER NOT NULL, 
    INSERT INTO Calendar 
    VALUES ('2007-04-05', 42), 
     ('2007-04-06', 43), -- good Friday 
     ('2007-04-07', 43), 
     ('2007-04-08', 43), -- Easter Sunday 
     ('2007-04-09', 44), 
     ('2007-04-10', 45); --Tuesday
    To compute the business days from Thursday of this week to next
     Tuesdays:
    SELECT (C2.julian_business_nbr - C1.julian_business_nbr)
      FROM Calendar AS C1, Calendar AS C2
     WHERE C1.cal_date = '2007-04-05',
       AND C2.cal_date = '2007-04-10'; 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Deactivate creation of new next inspection date on re-GR

    Our user created GR (MIGO) against a PO and subsequently a new batch with a next inspection date was created based on inspection interval set to 730 days.
    The user agin after a few days did GR against the same PO and the next inspection date was again calculated based on this GR date and the interval. We do not want this re-assignment of the next inspection date once it has been set. Please help.
    Mrunal

    The problem is a user error.
    When you receipt a material that has a shelf life requirement, you must enter in the production date, (manufacture date), in the GR.  If you don't, it will default in the current date and usse that to calculate the expiration date.
    On the second receipt, the same thing will happen.  If the same batch is specified, if I remember correctly, the system should give a message that "batch has already been receieved" or some kind of warning.  For the production date, I believe it will still default in the current date.  I think there is another warning that the expiration date will be recalculated and a "do you want to continue" question.  If they blow through all these warnings, the system takes the new manufacture date and recalculates the new expiration date.  To the best of my knowledge you can't change this.  The users must be trained to ALWAYS enter in the correct prodcution date. 
    FF

  • Payment terms should calculate Payment due date based on working days

    Hi Experts,
    As we know that standard SAP calculates Payment due date= base line date + number of days maintained in payment terms. In this payment days are considered as calendar days and not the working days.
    Example: If base line date is Thursday, payment terms says 3 days then payment due date is calculated as Sunday ( which is not a working day as per the factory calendar I use). The requirement is that payment date should be calculated as following Tuesday considering Satuarday and Sunday are not working days as per the calendar.
    Can you please suggest how can we achieve this?
    Thanks,
    Ravi

    You can not acheive from config pooint of view but you can use BADI and get the solution
    use BAdI MRM_PAYMENT_TERMS to set terms of payment
    You can use this Business Add-In to change the following fields for the 
    terms of payment in the invoice document header:                        
    o  ZFBDT: Base date for due date calculation                            
    o  ZBD1T: Discount days 1                                               
    o  ZBD1P: Discount percentage 1                                         
    o  ZBD2T: Discount days 2                                               
    o  ZBD2P: Discount percentage 2                                         
    o  ZBD3T: Deadline for net condition                                    
    o  ZLSPR: Key for payment block

  • How can I get next Saturday date ?

    I have a java.util.date, I want to get date of next saturday just after this date.
    I how can I calculate next saturday's date in a simple way?
    thanks in advance.
    Metin

                    GregorianCalendar today = new GregorianCalendar();
                    today.add(Calendar.DAY_OF_WEEK, Calendar.SATURDAY - today.get(Calendar.DAY_OF_WEEK));
                    System.out.println(today.getTime());
                // or better becaue it does not rely on the ordering of the enumerations
                    GregorianCalendar today = new GregorianCalendar();
                    while (today.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY)
                        today.add(Calendar.DATE, 1);
                    System.out.println(today.getTime());             
                }

  • Next Backup date 12/30/1899 12:00am error

    Hi,
    Firstly I'd like to mention that I have found posts with the same question-error, tried everything that was proposed as a solution and still face this situation. I have a windows 2008 server with AD and client PCs all living together on the same domain.
    This backup error is present at some client Pcs while others run the backup scheduled flawlessly.
    Once again I mention that I have double checked that I have correct Time Zones, correct date and time, both in Windows and BIOS. Have tried to change the scheduled tasks' "configure for" part to windows 7 and so, with no result. And generally everything
    else that was proposed at this post, http://answers.microsoft.com/en-us/windows/forum/windows_7-system/next-backup-date-reads-12301899-1200am/62637bf9-7de4-446a-be51-f68e299c9ea1?rtAction=1411015328406 , I have tried to do with no luck. So I am asking for
    help on this issue, because it can't be that some PCs of mine work fine and some are not. Thank you in advance for your support.

    Hi,
    It sees that there is something wrong with the schedule task manager, you could refer to the thread below to troubleshoot the issue:
    Win 7 Backup and Restore schedule problem
    https://social.technet.microsoft.com/Forums/windows/en-US/411a849a-aff3-4fa7-a2b0-5286e13a65a6/win-7-backup-and-restore-schedule-problem?forum=w7itprogeneral
    Best Regards,
    Mandy
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • How to calculate next 12 months

    Hi Gurus,
    If a user enters a date like : 15.05.2007, I need to calculate next 12 months values.
    i.e. low = 16.05.2007
         high= 15.05.2008.
    Any help greatly appreciated. Thanks.
    Best Regards,
    Reddy.

    data: l_month         type i,
            l_year          type i,
            l_sum_of_months type i.
    data : V_DATE TYPE  D,
             V_MONTHS TYPE  I DEFAULT 0,
             E_DATE TYPE  D.
        l_sum_of_months = v_date+4(2) + v_months.               "YREM981595
        l_month         = ( l_sum_of_months + 1 ) mod 12.       "YREM981595
        if l_month eq 0.
          l_month = 12.
        endif.
        l_year  = l_sum_of_months div 12.
        l_year  = l_year + v_date(4).
        if l_year gt 9999.
          e_date      = con_hidate.
        else.
          e_date+6(2) = '01'.
          e_date+4(2) = l_month.
          e_date(4)   = l_year.
          e_date      = e_date - 1.
        endif.
    rewards if useful,
    regards,
    nazeer

  • Creating PDF in Javascript in Adobe DC?

    Hi,
    Just wondering if anybody knows if creating a PDF in Javascript will get any easier in Adobe DC?
    I need to generate a report in Javascript.
    - The Report object doesn't give me enough control over formatting.
    - external data objects don't allow me to save the file automatically
    - If I generate a PDF, I have to put the report data in a text field. I can't just write text to a PDF.
    So is this going to improve in the new DC SDK, or is it more of the same?
    Thanks.

    You can create a document, add text fields, fill the fields, and flatten the form fields.

  • Calculating the next meeting date and the number of days until that

    Hi all,
    I created a meeting log page and I made a query that returns the most recent meeting date:
    to_char("MFR_MEETING_LOG_MAIN"."ML_MEETING_DATE",'MM/DD/YYYY')
    What I want to do is to calculate the next meeting date which is 6 month after the most recent meeting and the number of days until the next meeting.
    How do I do that? THank you very much for the help in advance!

    Basic SQL:
    Datetime/Interval Arithmetic.
    ADD_MONTHS function.
    If you're new to Oracle and SQL it may be advisable at this point to complete the Database 2 Day Developer's Guide.

  • Query to return next 7 dates

    Hello,
    is there a way to return the next 7 dates just using a query... for example, I need a query that returns:
    select (I don't know that put here) from dual
    Date
    2012-10-05
    2012-10-06
    2012-10-07
    2012-10-08
    2012-10-09
    2012-10-10
    2012-10-11
    If possible, I would like to know if there's a way to pass a date and based on it, the query returns the next 7 dates based on the passed date... for example:
    select (I don't know that put here) from dual where date > '2012-10-15'
    Date
    2012-10-16
    2012-10-17
    2012-10-18
    2012-10-19
    2012-10-20
    2012-10-21
    2012-10-22
    I really appreciate any help
    Thanks

    Sven W. wrote:
    I don't like connect by. That is fair enough, it is just your opinion.
    It is slow and shouldn't be used for real production code.This however, is absolute garbage.
    Changing the query to return 10,000 dates takes a little over 1s
    SQL> select date '2012-10-15' + level - 1 from dual
      2  connect by level <= 10000;
    <snip>
    28-FEB-40
    29-FEB-40
    01-MAR-40
    10000 rows selected.
    Elapsed: 00:00:01.26>
    In your case you can simply do this
    with inputdata as (select to_date('2012-10-15','yyyy-mm-dd') startday from dual)
    select startday+1 from inputdata union all
    select startday+2 from inputdata union all
    select startday+3 from inputdata union all
    select startday+4 from inputdata union all
    select startday+5 from inputdata union all
    select startday+6 from inputdata union all
    select startday+7 from inputdata ;
    Running your alternative for 10,000 dates took quite some time to create, needed to be put in a file to execute and has been running now for about 15 minutes
    select date '2012-10-15' + 1 from dual union all
    select date '2012-10-15' + 2 from dual union all
    <snip>
    select date '2012-10-15' + 9996 from dual union all
    select date '2012-10-15' + 9997 from dual union all
    select date '2012-10-15' + 9998 from dual union all
    select date '2012-10-15' + 9999 from dual union all
    select date '2012-10-15' + 10000 from dual
    ;It is much more code, takes more time to write, is proven to be incredibly slow and shouldn't be used for real production code.
    Edited by: 3360 on Oct 5, 2012 9:52 AM
    Sorry it took only 12 minutes, it seemed a lot longer when waiting for it
    29-FEB-40
    01-MAR-40
    01-MAR-40
    02-MAR-40
    10000 rows selected.
    Elapsed: 00:12:01.35

  • How to get page number from the PDF using Javascript

    Hi,
    We are having list of Single page PDF. The pdf are named in the order,
    ISBN_Author_01.PDF  (with real page number as i)
    ISBN_Author_02.PDF  (with real page number as ii)
    ISBN_Author_03.PDF  (with real page number as iii)
    ISBN_Author_04.PDF  (with real page number as 1)
    ISBN_Author_05.PDF  (with real page number as 2)
    ISBN_Author_06.PDF  (with real page number as 3)
    ISBN_Author_nn.PDF  (with real page number as 500)
    Here each pdf has a page number and in sequential order.
    The task is to check whether all the pdfs are in sequential order (i.e i, ii, iii, 1, 2, 3). If any page is missing, the script should throw an error report.
    To do this task, I am writing a Javascript to get the real page number from the PDF.
    Can anybody help me how to get the page number from the PDF using Javascript.
    Thanks,
    Gopal

    The "real" page number within a PDF is the count of the physical page starting at 0, zero.
    pageNum numPages
    The number printed on each page is the page label.
    setPageLabels  getPageLabel
    You will have to open each PDF and your script would need to know the page label for that file. I would expect you would need to build a 2 dimensional  array of the file names and the page label for the page within that array.

  • How to calculate the 'real data of arrival' in PO item

    Hi,
    Confirmation control keys with control type u201CDAu201D are MRP relevant
    1.     = New field time of transportation in calendar days
    2.     = Confirmation control type u201CABu201D (order confirmation)
    3.     = Confirmation control type u201CLAu201D (shipping notification)
    4.     = Confirmation control type u201CDAu201D (Date of arrival)
    When data 1-3 has been changed = 4 will be calculated again.
    Program requirements to calculate the u201Creal data of arrivalu201D:
    1.     When 1 >0 days then create 4 directly after placement of 2 (2 can be placed manually or automatically)
    2.     4 must be calculated: AB delivery date 2 + calendar date amount 1 = arrival date 4 (MRP gets a confirmed delivery      date by vendor plus transportation time)
    3.     When changes in 1 then change 4 (add calendar days to arrival date DA)
    4.      When changes in 2 then change 4 = u201Cnewu201D delivery date 2 plus calendar days 1 = new arrival date 4
    5.     When 3 u201CLAu201D is entered (manually/automatically) then calculate: shipping date LA 3 plus calendar days 1 = new arrival date in 4
    6.     When 1 has been changed then calculate 4 new (Check is 2 existing then use 2, check is 2 + 3 existing then use 3)
    7.     When 2 or 3 has been changed quantity then also update quantity in 4
    8.     When 2 has been canceled then cancel 4, too
    9.     When 3 has an inbound delivery document no. in place then copy the same no. in the inbound delivery field 4 and in the new column in MRP (MD04, see MRP view below)
    i have a lot of confuseging in this lines of code,even where u write i don't know in BADI . we are implement in BADI only.
    if possiable give me code for this requriment. . this line of code in which method we write,please guide me.............

    SDN is not your code factory, please research yourself before posting, maybe ask whoever handed you this requirement?
    Thread locked.
    Thomas

  • Need a function to calculate employee attendance data for a given period

    need a function to calculate employee attendance data for a given period
    as
    Working days,
    CL ,
    SL,
    PL,
    LWP
    regards,
    Gaurav Sood.

    Issue resolved

  • Next inspection date is not updated in batch / prposed at the time of UD

    Hi
    I have configurted the system for retest of batches, the system successfully creates the inspection lot but when does not propose next inspection date at the time of UD nor it updates in Batch Master.
    I entered inspection interval days in QM View, the system entered the first inspection date correctly. Also Batch Restriction is working properly.
    Kindly help.
    regards
    Mobashir

    Hi Shaymal & VRMP
    I have checked the system, the only problem I am facing is that the system does not show next inspection date dialog box at the time of UD where I can see the next inspection date being set by the system
    Say, I use QA07 (Triggered Manually) on 19.jan.08. The Next inspection date was 26.jan.08 and Initial Run in Days was 10 (days), the system created inspection lot on 19.jan.08 successfully. At the time of UD it automatically set 29.jan.08 as the next inspection date (i.e. 19.jan.08 + 10 days)  istead of 06. Feb.08 (i.e. 26.jan.08 + 10 days) without showing dialog box / suggesting next inspectino date. 
    regards
    Mobashir
    Edited by: Muhammad Mobashir on Jan 19, 2009 7:11 AM

Maybe you are looking for

  • Slow All of a Sudden

    I've tried everything I know to correct slow performance. All of a sudden my computer is running really slow. Even if only firefox is open, video playback with webbrowser is stuttering horribly. I would really appreciate help.

  • Unzip data received from web service?

    In my Apex 3.0.1 application I am trying to obtain data from a web service. The problem is that the returned data is first zipped and then encoded using base 64 coding. I can decode the data using the utl_encode package and if I download the result,

  • A Question About Message Driven Bean Exception Handling

    "Your onMessage method should handle all exceptions. It must not throw checked exceptions, and throwing a RuntimeException is considered a programming error." The above sentence is from the JMS documentation. I will use a message driven bean for guar

  • How to maintain our own  search help

    Hi Everybody This is Vijai. Im facing a problem with maintaining my own search help. Like what i have to do if i want a search help in the sap screens. Thanks in Advance and cheers Vijai

  • How to create Talent Group in Talent Management System (Infotype 7420)

    Hello All, Can anybody let me know how to create talent Group entries in SAP HR TMS module (infotype 7420). And one more thing if somebody know how to link application area for a user in TMS. Mani