Prepopulate DateField with Today's Date

Below is the code I currently have:
import mx.controls.*;
private function retrieveDate():void {
requestDate.text += new Date();
<mx:FormItem label="Request Date:" fontFamily="Gotham"
fontWeight="bold" fontSize="12" x="39" y="68" width="228">
<mx:DateField id="requestDate" text="{retrieveDate()}"
width="114" showToday="true" enabled="true"/>
</mx:FormItem>
I know it's got to be something simple I'm missing. Thanks in
advance for solutions!

I think you need to set the initial text in the app
initialize event.
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
initialize="retrieveDate()">
<mx:Script>
<![CDATA[
import mx.controls.*;
private function retrieveDate():void {
requestDate.text += new Date();
]]>
</mx:Script>
<mx:Form>
<mx:FormItem label="Request Date:" fontFamily="Gotham"
fontWeight="bold"
fontSize="12" x="39" y="68" width="300">
<mx:DateField id="requestDate" width="300"
showToday="true" enabled="true"/>
</mx:FormItem>
</mx:Form>
</mx:Application>

Similar Messages

  • ICloud photos sync with today's date instead of date taken

    I just got a new laptop for work and installed iCloud to sync my PhotoStream to it. The photos all synced, but they are displaying a modified date of today instead of the date the photo was originally taken. On my old laptop, the photos seemed to display a Modified Date closer to the date they were taken. When I look at the photos on my iPhone, they all have the correct Modified Date. Something is causing the Modified Date to be switched to today's dte when they sync. Does anyone know why? Is this always how iCloud works and I just have noticed it because my photos were syncing to my laptop as soon as I added them to the stream? Or is there an iCloud setting or file system permissions thing causing this?

    thank you for your response. strange, though, the vids used to export with the file date that i shot the vid... it's only since i updated iphoto that this is happening. but i like your idea of adding the date to the file name... i just wish i didn't have to do that extra step now, since i have a lot of videos.

  • Printing PDF document with today's date

    I am looking for a way to print the current date on the PDF
    document. Perhaps, a field/variable/marker on the PDF document
    where it will be converted to the today's date at the time the
    document is being printed.

    Hello,
    I'm sorry I'm not able to address your question. These forums
    are specific to the
    Acrobat.com website and its set of hosted services, and do
    not cover the Acrobat family of desktop products.
    Any questions related to the Acrobat family of desktop
    products would be best suited in the Acrobat User Forums:
    Link to
    Acrobat Forums
    Thanks!
    Michelle

  • Variant with today's date

    Hi,
       Can anyone let me know how to create a variant with a date field and it should have the value as the run date?
    Thanks!
    Uma.

    In SE38 choose the variant and for the fields you want to set the date fields as dynamic value you must choose the D - Dynamic Date Calculation options and make it as Current date.
    This will solve your problem. When the variant is used for background/scheduled jobs it will use the execution date.
    Regards
    Kathirvel

  • How do I write a query to give back the records only with today's date?

    For example the date format is "2014-05-01 16:31:35.897" is a column called "EffectiveStartDate'
    I tried using where EffectiveStartDate like '2014-05-01%' but that returns nothing.

    This is not a good suggestion from Chuck although normally he provides very good responses. I unmarked that response.
    Please read this article by Aaron Bertrand:
    http://sqlblog.com/blogs/aaron_bertrand/archive/2009/10/16/bad-habits-to-kick-mishandling-date-range-queries.aspx
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Help with today's date - 2 days as a string for a file name

    This will be an Expression/Connection String for a Flat File Connection Manager.
    Need it in this format COMPANY20150402.txt except the formula needs to incorporate the DATEADD("D", -2, Getdate())
    "COMPANY" + (DT_STR,4,1252) DatePart("yyyy",getdate()) +
    Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
    Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2)  +".txt"
    Where do I add the DATEADD part? and be syntactically correct?
    TIA
    Harry

    You do get COMPANY20150402.txt outputted from your expression
    just keep adding DATEADD("DAY",-2,.... to each getdate()
    like
    "COMPANY" + (DT_STR,4,1252) DatePart("yyyy",DATEADD("DAY",-2,getdate())) +
    Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) +
    Right("0" + (DT_STR,4,1252) DatePart("d",getdate()),2)  +".txt"
    Arthur
    MyBlog
    Twitter

  • Do I need to use javascript to get a text field in a PDF form to aut fill with current/today's date?

    I have a form for booking appointments and would like the date field to automatically fill with
    today's date and to print. I have set the text field's format to "Date" and when I place the cursor into the
    date field, today's date shows. It disappears as soon as I tab to the next field.
    Does this action require a javascript script to fill and print today's date? If so, where do I find that?
    Or is there another way to format the text field (besides typing today's date) to get the current date?
    Thanks.
    Ali
    using iMac 2.93 GHz Intel Core 2 Duo 8 GB | OS Snow Leopard 10.6.8 | Acrobat Pro 8

    Thank you GKaiseril!
    From the examples by Chris Dahl, I edited the script in the text field editing dialog to reflect the title I had given the field. That fixed the problem of today's date disappearing as soon as I tabbed to the next field.
    How do I choose for document level or page open script? I would like it to insert the date upon opening the document.
    Thanks again.
    Ali
    NOTE: I found the answer within Chris Dahl's tutorial... path is for Acrobat Pro 8: Advanced>Document Processing>Document Javascripts

  • Date query doesn't show results for today's date

    Hello everyone. I use Jdeveloper 11.1.1.3.0 with ADF and I have a view named query with just one field, Date. The operator it is using is equal to a value written in the field. The problem is that when I insert a row into the table (the date is automatically set to the current date on insertion) and I look for today's date it returns nothing. However if I leave the field empty it will find me the row. I tried doing this with the timestamp option but it's not very user friendly as the user would have to type in the time the row was inserted in order to find it, or use the between operator for two fields which is something I want to avoid if at all possible
    The requirement is one field query that lets the user choose a date from a calendar and shows all rows inserted on that date (even if the date is today and the row was inserted a few minutes before).
    Edited by: Dino2dy on Apr 6, 2011 2:50 AM

    Dino2dy,
    My guess is that the data being stored in the DB has a time component associated with it (as it would if you were using something like SYSDATE to populate it). When you are trying to look for data with today's date, you are checking just for the date - which in Oracle is the equivalent of midnight on the start of the date. The dates don't match because the time is different.
    Either store the date with no time component (use TRUNC to remove the time), use a BETWEEN comparison, or TRUNC the date when comparing.
    John

  • Using today's date in selectableRange of dateField

    i'm having issues with the dateField component. i would like
    to dynamically specify today's date as the rangeEnd of the
    selectableRange, but i can't seem to get it to work.
    can someone show me how to create a dateField component that
    does not allow you to select a date in the future?

    It was working for me before. I didn't create the instance
    using the UIObject method - it was just in the authoring
    environment.
    Don't ask me why this is necessary, but I think it will do
    what you want. You may want to take away the +1 if you just want it
    to be today. At the moment it includes tomorrow.

  • I just downloaded 950 photos on iPhoto and deleted them off my camera and now under last import there is only 4 photos and i can't find the others?? There is a whole bunch of blank events in the library with no photos in them all with todays date? Help!!

    I just downloaded 950 photos on iPhoto and deleted them off my camera and now under last import there is only 4 photos and i can't find the others?? There is a whole bunch of blank events in the library with no photos in them all with todays date? Help!!

    Yes - you need a min of 10 GB just to operate - with just 1 you certainly can lose photos and other critical things - you need to make space immediately - probably by moving your iPhoto library to a volume formatted Mac OS extended -
    Moving the iPhoto library is safe and simple - quit iPhoto and drag the iPhoto library intact as a single entity to the external drive - depress the option key and launch iPhoto using the "select library" option to point to the new location on the external drive - fully test it and then trash the old library on the internal drive (test one more time prior to emptying the trash)
    And be sure that the External drive is formatted Mac OS extended (journaled) (iPhoto does not work with drives with other formats) and that it is always available prior to launching iPhoto
    And backup soon and often - having your iPhoto library on an external drive is not a backup and if you are using Time Machine you need to check and be sure that TM is backing up your external drive
    LN

  • Set Basic finish date in serviceorder with today + 10 days

    Hi,
    when we create an service order (IW31) the Basic start date and Basic finish date has default
    value of today.
    I will set Basic final date as default with today + 10 days.
    I have search in SPRO but don't find any way.
    Is there an EXIT or BADI to do this?
    thanks.
    Regards, Dieter

    Hi Paul,
    thanks for your answer, i have tried it, but no effect.
    I have to clear what i really want to have (sorry that i havn't done it in the first thread.
    First we create an Service notification via IW51, and go direct via "create" button to "create order".
    A little popup is shown to insert order type, planning plant, main work center. After press enter
    we are in create Service order (with revenues) at this time i don't insert any value.
    Now the value of "Basic start date" and "Basic finish date" has a value of today, it seems that these
    value are set as default, priority is empty.
    Now i want that the 2 date-fields are set as default with today and today + 10 days.
    How can i do this?
    Regards, Dieter

  • New IMac - transferring data with Lexar jump drive - all files come across as modified with todays date not date formed as on the old computer (also an IMac) what gives.

    I purchased a new Imac and when transferring data with a Lexar Jump drive the filed come across as modified with todays date rather than the date that the files were created. How do I keep the files as they are?

    I purchased a new Imac and when transferring data with a Lexar Jump drive the filed come across as modified with todays date rather than the date that the files were created. How do I keep the files as they are?

  • I can't get today's date to show on my html pages with Javascript codes.

    I use javascript 1.2 codes to show up today's date on my HTML pages but it did not execute.
    Here is my code:
    <script language="Javascript">
    <!--
    document.write(displayDate());
    // -->
    </script>
    Please help! If you know how to get it to execute.
    Thank you.

    I don not know what displayDate() means
    But I am display current date and time with the code...
    <script language="Javascript">
    <!--
         document.write((new Date).toLocaleString());
    // -->
    </script>

  • IWeb blog entry with an earlier date than today?

    Is there a way to create an entry in iWeb that has a date before today's date? Say I want to create an entry of something that happened five days ago... When I create an entry, it automatically sets the date to today. Is there any way to change the date backwards for the entry?

    Possibly not. When you highlight and erase it, it doesn't help you make a new one, but the font size and color settings remain. I just re-wrote the dates I wanted in the same way they had already been written (day, month, date, year).
    Example on my non-profit site, all the journal entries were entered on the same day (Jan 25), but I changed the dates on them to reflect when they were actually written by the author. See under "Journal" page in this site linked here: http://www.catalinafoundation.org

  • Issue with Ord Start Date

    Hi,
    I am having issue with Ord Start Date.
    When i create XYZ Asset now when i do the acquasation for that new asset. Example: Using FB01 i enter todays date and i do the posting.
    Now when i go to DEP Area TAB for the DEP Key (M200) - The Ord Dep Start Date is 15 Dec 2010.
    For this DEP Key Period Control Methods (T code - AFAMP) - Acquisation Entered is ( 6 that is - at the start of year) and the Period Control is ( T code - OAVS) (4 that is - First year convention at half year start date).
    Our client is using the fiscal year as 1 June 2010 to 31 May 2011.
    So when i do acquistion for the asset as per the period contol the Ord Dep Start Date should be 1 Dec 2010, but here it is talking 15 Dec 2010.
    Why is system talking 15 days more.
    Regards.

    Hi
    Which Fiscal year variant are you using??
    Did you maintain it in OAVH? Copy the existing entry in OAVH for K4 to your Fisc Yr var and try again
    And also, 04 does not figure for Acquisitions in AFAMP under 0004.... Whatever you specify in OAVH must also be a part of AFAMP
    Regards
    Ajay M
    Edited by: Ajay Maheshwari on Oct 28, 2010 2:31 PM

Maybe you are looking for

  • How to get the last day according to fiscal period input in selection scree

    Hello expert how to get the last day of fiscal period input. the fiscal period inculdes 1-16 when fiscal period is greater than 12, only calculate the last day of 12nd month your solution will be apprecaited, FM existing? thank you Kevin

  • Deployment of static html files (for the documentation of the application)

    I'm developing with forms 11g for windows and deploying on linux. I want to deploy the help docs of my application, which I've already migrated from hlp to html / css. Now, I would like to know where can I deploy that html files to invoke them with w

  • How to activate trace for web services

    Hi Experts, How to activate trace for web services in SOAMANAGER. We are not able to view the Payload trace of the error logs. Can anyone please let me know how to go about this??? Regards, Ashwini

  • Limited codecs choices in QT Pro and other applications

    On my home computer when I access QT Player and use the export option and export as a QT movie, I have a long list of encoders to choose from in the drop down selection list.  Apple ProRes 422 is among them. On my work computer when I try to select a

  • Exporting to a Windows Media File- best quality????

    I imported a 15 -slide powerpoint (converted to jpeg) and added music, and Premiere transitions The Premiere movie is about 3 minutes long. I then needed to save (and burn to disks) as a Windows Media File.  A program that all of my 35 business offic