Javascript Date() function not working

Hi,
I'm experiencing some problems with the Date() function in javascript. The problem is that the function doesn't seem to work. For example when I do "var date = new Date(); xfa.host.messageBox(date);" in the enter event of a date field, I get "Date is not a function" error message in de javascript debugger.
Is there anyone out there who knows how why the Date function is not working in LiveCycle Designer. Am I using the Date function in an improper way or maybe I am using the wrong function?
Please can anyone help me out?

Hi Paul,
Thanx for you reply. It worked fine.
I also found out that following works as well:
var MyDate = util.scand("dd-mm-yyyy",new Date());
console.println("this date: "+util.printd("dd-mm-yyyy", MyDate));

Similar Messages

  • Trunc date function not working correctly

    Hi,
    Another quick question if people don't mind. Bit confused about the trunc date function. I'm following the sql fundamentals exam guide and using their examples:
    select trunc(to_date('02-jun-2009 13:00','dd-mon-yyyy hh24:mi')) day from dual;
    this returns the 2nd of june, as it should, because, as far as i'm aware, leaving the optional variable out defaults the precision to 'day'. but when i explicitly add the variable 'day', as the guide has done with 'week' 'month' and 'year' in the following examples (so i assume this format is correct rather than dd/mon/yyyy), something goes wrong:
    select trunc(to_date('02-jun-2009 13:00','dd-mon-yyyy' hh24:mi'), 'day') day from dual;
    this returns the 31st of may. which is incorrect.
    however replacing 'day' with 'dd' provides the correct answer of the 2nd again.
    this isn't a major issue, it just bothers me that the guide seems (again) to be mistaken, something that is rapidly becoming a trend in their examples. i'd also quite like to know why this is happening, as it will help improve my understanding of sql in general - perhaps there is some sort of default to allow the correct use of the variable 'day' i'm overlooking and that the guide hasn't made clear.
    btw, i'm working in sqlplus - although developer has some odd results too.
    thanks alot,
    nick

    967660 wrote:
    Hi,
    Another quick question if people don't mind. Bit confused about the trunc date function. I'm following the sql fundamentals exam guide and using their examples:
    select trunc(to_date('02-jun-2009 13:00','dd-mon-yyyy hh24:mi')) day from dual;
    this returns the 2nd of june, as it should, because, as far as i'm aware, leaving the optional variable out defaults the precision to 'day'. but when i explicitly add the variable 'day', as the guide has done with 'week' 'month' and 'year' in the following examples (so i assume this format is correct rather than dd/mon/yyyy), something goes wrong:
    select trunc(to_date('02-jun-2009 13:00','dd-mon-yyyy' hh24:mi'), 'day') day from dual;
    this returns the 31st of may. which is incorrect.
    however replacing 'day' with 'dd' provides the correct answer of the 2nd again.
    this isn't a major issue, it just bothers me that the guide seems (again) to be mistaken, something that is rapidly becoming a trend in their examples. i'd also quite like to know why this is happening, as it will help improve my understanding of sql in general - perhaps there is some sort of default to allow the correct use of the variable 'day' i'm overlooking and that the guide hasn't made clear.
    btw, i'm working in sqlplus - although developer has some odd results too.
    thanks alot,
    nick'day' doesn't trunc to the beginning of the day. It truncates to the first day of the week: in your case 31st May.
    'ddd' truncates to the beginning of the day.
    So, leaving the second parameter out defaults to 'ddd' not 'day'.

  • Simple Javascript date() function not executing.

    If I open the javascript input window from a button and enter a simple js date function:
    vDate = new Date();
    alert(vDate();
    This code executes flawlessly when the button is clicked.
    However,  if I place the exact same code in the Execute Advacned Actions javascript window "on enter frame" Action, the alert popup code not exdecute/appear, it will fail silently.
    I'm simple trying to get a javascript funtion to execute on... the On Enter Action.
    Any suggestions?
    Thanks

    Hello,
    I just tried the scenario and I can see that JS code is executing properly. I used the same JS as you have given (just corrected the syntax in the second line). So, I create an Advanced action that has this JS, and I assigned that to "On Slide Enter" action of the slide. Other thing that I did is that I chose "current" as the window in the Execute Javascript options.
    Ashish

  • Javascript sort() function not working correctly

    I have an image gallery that automatically loads via a PHP readdir function which populates an array, and then I have a Javascript sort() function which sorts the images in order numerically. In Chrome and Safari, the images display as numbered in the directory. However, in Firefox and Internet Explorer, they display out of order (firefox) and not at all (ie). Here is the code for the php file: <?
    Header("content-type: application/x-javascript");
    function returnimages($dirname=".") {
    $pattern="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)";
    $files = array();
    $curimage=0;
    if($handle = opendir($dirname)) {
    while(false !== ($file = readdir($handle))){
    $file = basename($file,".jpg");
    echo 'myImg['.$curimage.']="'.$file .'";';
    $curimage++;
    closedir($handle);
    return($files);
    echo 'var myImg=new Array();';
    returnimages()
    ?>
    and here is the code for the javascript sort:
    function sortNumber(a,b)
    return a - b;
    myImg.sort(sortNumber);
    // Tell browser the type of file
    myImgEnd = ".jpg";
    var i = 0;
    // Create function to load image
    function loadImg(){
    document.imgSrc.src = myImg[i] + myImgEnd;
    Any ideas as to why Firefox is behaving this way?

    After you check the box to sort on the column, are you making sure to select a sort order for the same column?
    Earl

  • Standard XSLT 2.0 date functions not working in PI 7.11

    What do I need to include to use the standard XSLT 2.0 functions - such as format-date,  Current-date() ?
    The code below works correctly in XMLSpy... but when I import the XSL as an Imported Archive in PI - it fails with...
    Method fatalError called, terminate transformation, because of
    javax.xml.transform.TransformerException: com.sap.engine.lib.xsl.xpath.XPathException: Function with name 'current-date' not found in context library. at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:250)
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:attribute name="today">
       <xsl:value-of select="format-date(current-date(),'[Y0001][M01][D01]')"/>
    </xsl:attribute>

    Hi,
    Try to use SAP XML ttol kit option in Operation mapping and let us know the result.
    Regards,
    Raj

  • Date Function not working properly

    Dear Gurus,
    I have a plan app and the pertinent essbase cube, I need to retrieve the no. of days for the curr month/year combination.
    On version 11.1.1.3 I used something like : @TODATE("dd-mm-yyyy",@CONCATENATE("01-01-",@NAME(@ALIAS(@CURRMBR("year"))))) / 86400;
    and it worked fine.
    When I moved the formula on the 11.1.2 version I get an error " invalid argument in function @_TODATE".
    I know that essbase was never really good with dates.
    Any help I appreciate.
    yannis

    Hi Yannis,
    1. I see no reason for it not to work on 11.1.2, when it had run flawlessly on 11.1.1.3.
    2. Looking at the tech reference of @TODATE, nothing seems to have changed , there is only one difference.which is the latest data supported by the function in 11.1.2 is 12-31-2037,while its 01-01-2038 in version 11.1.1.3.
    3. Sounds silly, but try to validate the formula which was resulting in errors in 11.1.2 , on 11.1.1.3 once.
    Sandeep Reddy Enti
    HCC
    http://hyperionconsultancy.com/

  • To date function not working

    Hi,
    I have been searching for hours to solve this problem.
    I can´t convert a date to only year, month or day etc...
    select sysdate, TO_DATE(sysdate,'YYYY') from dual
    ORA-01830: date format picture ends before converting entire input string
    01830. 00000 - "date format picture ends before converting entire input string"
    select sysdate, TO_DATE(sysdate,'MM') from dual
    ORA-01843: not a valid month
    01843. 00000 - "not a valid month"
    select sysdate, TO_DATE(sysdate,'DD') from dual
    ORA-01830: date format picture ends before converting entire input string
    01830. 00000 - "date format picture ends before converting entire input string"
    Please, if this is not the right category to post in just address me to the right one.
    Thanks,

    user12981132 wrote:
    Many thanks to all,
    Indeed in worked on the sysdate. But I still have a similar problem. I wanted to provide an example you could reproduce on your own, that´s why I used the sysdate from dual. But my main problem is that I have a VARCHAR2(8 BYTE) data type for a date, when a try to format it to a date it returns the same error:
    Ok, so because your real data is a varchar instead of a DATE, your example with sysdate was nothing like reality.
    select fealta from david.socipart
    returns for example: 19140731So it looks like your varchar data that represents a date is in the format yyyymmdd.
    >
    when I want to change it to date and get year, month, day as before it doesn´t work. And in this case I am not trying to convert the same data type:
    select to_date(fealta,'yyyy') from david.socipartAnd here you try to convert your varchar to a DATE, but you are telling to_date to interpret the character string as if it were simply YYYY, which of course ends before the actual data ends .....
    ORA-01830: date format picture ends before converting entire input string
    01830. 00000 - "date format picture ends before converting entire input string"
    ... resulting in an error message that tells you that.
    select to_date(fealta,'rrrr') from david.socipart
    ORA-01830: date format picture ends before converting entire input string
    01830. 00000 - "date format picture ends before converting entire input string"
    select to_date(fealta,'mm') from david.socipart
    ORA-01843: not a valid month
    01843. 00000 - "not a valid month"
    select to_date(fealta,'dd') from david.socipart
    ORA-01830: date format picture ends before converting entire input string
    01830. 00000 - "date format picture ends before converting entire input string"
    But when I do this it works fine:
    select to_date(fealta,'yyyymmdd') from david.socipart
    1914/07/31
    So, finally you gave to_date the correct description of your character string. And when you did, oracle then had to follow up with an implied use of to_char to convert the DATE back to a character string for presentation in the output. It used the controlling setting of NLS_DATE_FORMAT to do so.
    * I did a alter session to change the date format to yyyy/mm/ddYour fundamental error is not understanding the difference between a DATE and a character string (VARCHAR2) the represents a DATE.
    And from that misunderstanding comes a misunderstanding of the use and purpose of the to_date and to_char functions, as well as the horrible design error of using a VARCHAR column to try to store a DATE.
    see: [url http://edstevensdba.wordpress.com/2011/04/07/nls_date_format/] But I want to store my date as ...
    Edited by: EdStevens on May 14, 2013 10:15 AM

  • Format Date function not working correctly

    Hi,
    I am using the following code to display a system date:
    <?xdofx:sysdate('DD-Month-YYYY')?>
    However the date always appears as:
    18-March -2011 (with space after 'March')
    rather than
    18-March-2011 (no space after the month)
    Can anyone tell me how to get the date to display without the space after the month?
    Thanks

    Some options:
    http://winrichman.blogspot.com/2008/08/xslt-extended-functions.html (right side screen shot)
    BI Publisher:formating date using xdofx
    Modify the output from current_date

  • Javascript Foucs is not working In IE

    I have tabular in in APEX page
    In tabular form on one textbox onblur="setfocs();"
    And i set focus on button using javascript as below.
    <script type="text/javascript">
    function setfocs()
    document.getElementById('add_row_id').focus();
    </script>
    Javascript in HTML header part of the page.
    'add_row_id' is button id.
    That is working fine in Firefox but not working on IE and Chrome.
    Can any one have idea?
    Thanks

    Hi,
    This is a documented issue. Please see http://www.mkyong.com/javascript/focus-is-not-working-in-ie-solution/
    Cheers,
    PS: Many more resource on the subject here
    Edited by: Prabodh on Jul 31, 2012 3:47 PM

  • ExportAsFDF javascript method is not working with Reader 10.1.1

    Hi,
    I have pdf document in which I have applied all Extendend Reader Rights. And now when I am trying to exports alll annotation in fdf with Reader 10.1.1 then it is faling to export. However it is working fine with Reader 10.0.0. Looks like this is broken in later version of 10.0.0.
    Please let me know if any alternative solution is there to export all annotation in fdf file thru code.
    Regards,
    Arvind

    I would open a formal support ticket with our developer support folks.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Sun, 27 Nov 2011 22:48:35 -0800
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: exportAsFDF javascript method is not working with Reader 10.1.1
    exportAsFDF javascript method is not working with Reader 10.1.1
    created by arvindg007<http://forums.adobe.com/people/arvindg007> in Acrobat SDK - View the full discussion<http://forums.adobe.com/message/4049525#4049525

  • After upgrading to maverick; help & other functions not working

    After upgrading to maverick; help and other functions not working?

    Sometimes just closing and reopening the Help window will clear up the problem. If it doesn't, log out or restart the computer and try again. Otherwise, you may need to delete the Help cache.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Caches/com.apple.helpd
    Right-click or control-click the highlighted line and select 
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder selected. Move the selected folder to the Trash. Log out, log back in, and test. Help pages will be slow to load at first.
    If that doesn't work, the problem may be caused by network conditions. It may go away by itself, though I can't say how long you should wait.
       A persistent failure to load help data has been reported as an issue with satellite networks. Test on a different network, if possible. I've also seen at least one report that Photo Stream in iCloud can mysteriously interfere with Help. I'm not sure whether that's true, but try disabling Photo Stream, if applicable.*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combinationcommand-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • Not able to sign into Blackberry Protect. Backup and Restore function not working. "Your device isn't associated with a Blackberry ID"

    Not able to sign into Blackberry Protect.  Backup and Restore function not working. Message is: "Your device isn't associated with a Blackberry ID."  My Blackberry Messenger and Blackberry World is working fine so I am sure its not an ID issue on the phone.  I can sign into Link, Blackberry.com and Protect.  I see my device in Protect but cannot send messages or view it on a map.  Times out with cannot reach device message.  BB Protect on Device has a swirling circle beside the on/of switch.  Cannot turn off.  
    I have deleted Link and re-installed.
    I have reset phone to default(factory) and signed in. 
    OS level is 10.2.1.3062
    BB Link is 1.2.3.56
    Solved!
    Go to Solution.

    I managed to figure this out myself. I had to delete the device from the Blackberry Protect website.  protect.blackberry.com.  I wiped my device again and signed in with my Blackberry ID.  I dont know if the step of wiping was necessary as I did not try my backup with the current configuration on the device following the delete.  Restore is in progress for me!

  • Copy/paste function not working in Firefox 22. Always good in previous versions

    Copy/paste function not working in Firefox 22. Always good in previous versions editions

    Well I've uninstalled FF22, thanks for the suggestion.
    Chrome works perfectly with ZA and C&P.

  • Why is the scroll function not working after accessing the voice feature in settings?

    Why is the scroll function not working after accessing the voice feature in settings?

    For some prerecorded audio files the Transpose slider will not work reliably. I found no clear pattern, when it does and when not.
    If all fails, create a loop from the audio file. Select the region in the track and use the command "File: Add region to Loop library".
    Set the current key and tempo, name the loop, and save the loop.
    Now add it from the loop browser to a new track and delete your old track. The search field in the Loop browser will help you to find the loop quickly.
    You will be able to transpose the sample as described above, like a regular loop.
    For example - a audio file turned into a loop and transposed:

  • DOCUMENT SETTING that ALLOW FUTURE POSTING DATE does not work in PL34

    Hi Expert,
    I am now using SAP B1 2005B (7.40.252) sp:00 pl:34 and realised that the ALLOW Future Posting Date was not working. 
    I still can remember while I was using pl:11 at B1 2005A, there is no such problem and wish to know when can the bug fix up? in which sp/pl?
    Wish to hear goods news ASAP .
    Thank you.
    Joan.

    Basically can you please clarrify your requirement as to what you want to change ..what I understand you would need to change the code for ABAP - RFEBBE00
    Value Date code in the above abap
            IF PAR_VALD = 'X'.
              MOVE C2-VALDT TO HLP_VALDT.  "  VALUE DATE
             write hlp_valdt to umsatz-budat dd/mm/yy.
            ELSE.
              MOVE C8-BALDT TO HLP_BALDT.
              MOVE HLP_BALDT TO HLP_VALDT.
            write hlp_valdt to umsatz-budat dd/mm/yy.
            ENDIF.
               MOVE HLP_VALDT(2) TO UMSATZ-BUDAT.
               MOVE HLP_VALDT2(2) TO UMSATZ-BUDAT3.
               MOVE HLP_VALDT4(2) TO UMSATZ-BUDAT6.
    Regards
    Anurag
    Message was edited by: Anurag Bankley

Maybe you are looking for

  • I have Two apple ids: one apple id will not authorize on same computer.

    I just purchased a new imac. I have two apple ids. Stupid, I know. I was able to authorize one of the apple ids on my iMac. When I try to authorize the other apple id, I get the message "We could not complete your iTunes Store request. The iTunes Sto

  • WAD - Values above Bar Chart not displaying.

    Hi All, Please find the report that created in WAD using Chart. From the above image, the numbers above the Bars is not displaying except the first Bar. I have checked the Series in WAD and all the settings are same Bar 1 and Bar 2. But still, the va

  • NetBoot images not showing on clients

    I have two Mavericks (10.9.4) servers from which I am trying to netboot to use DeployStudio to deploy Fall semester images. None of the clients see the images offered by either server either from the Startup Disk pref pane or by holding option or N a

  • Disconnected when creating a materialize view

    when i try to create a materialize view from a "big" select (a select from several other selects), it doesn't create the view and i get disconnected from the database.

  • Object Library Feed Back

    can i use an OL for Forms 10G to Forms 6i..?