Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 961563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:21:55+00:00 2026-05-16T01:21:55+00:00

I inserted a dateField component. On clicking, it displays calendar. I would like to

  • 0

I inserted a dateField component. On clicking, it displays calendar. I would like to add 2 comboboxes, one shows hours (0 to 23) and other for minutes (0 to 59), to the calendar so that the user can select the time along with the date, and that will be displayed in the text input as date and time. One more thing I would like to add is clear button to clear the selected date in the calendar.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T01:21:55+00:00Added an answer on May 16, 2026 at 1:21 am

    Since a DateField is essentially a TextInput coupled with a DateChooser, why not do that yourself? Also add your two ComboBox, make your TextInput editable=”false” text=”{dateTime}” where dateTime is a Bindable string variable you create as the concatenation of the values in the DateChooser and the two ComboBox. Call the function that creates the dateTime string on the change event of all three inputs.

    Finally, add your clear Button, and have its click event call a function where you set the DateChooser to today, and the two combo boxes to default values, and update dateTime string as needed (to blank or to current date/time depending on what you are trying to do.)

    Edit:
    As you asked nicely, and as I am studying for the ACE exam and thought this made a nice excercise, here is what I came up with. I made the following custom component in a package named ‘components’ and called it ‘myCustomDateField.mxml’

    <?xml version="1.0" encoding="utf-8"?>
    <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
    initialize="resetDisplay()">
    <mx:DateFormatter id="dateFormat" formatString="DD-MMM-YYYY JJ:NN" />
    
    <mx:Script>
    <![CDATA[
    
    [Bindable]
    public var dateTime:Date;
    
         private function updateDisplay():void {
        var userDate:Date = new Date();
        userDate.date = cal.selectedDate.date;
        userDate.month = cal.selectedDate.month;
        userDate.fullYear = cal.selectedDate.fullYear;
        userDate.hours = hour.value;
        userDate.minutes = minute.value;
        dateTime = userDate;
    }
    
    private function resetDisplay():void {
        var now:Date = new Date();
        cal.selectedDate = now;
        hour.value = now.hours;
        minute.value = now.minutes;
        dateTime = now;
    }
    
    ]]>
    </mx:Script>
    
    <mx:Label text="Select Date and Time:" />
    <mx:TextInput id="display" text="{dateFormat.format(dateTime)}" editable="false" />
    <mx:DateChooser id="cal" yearNavigationEnabled="true" change="updateDisplay()" />
    <mx:Label text="Hour:" />
    <mx:NumericStepper id="hour" minimum="0" maximum="23" change="updateDisplay()" />
    <mx:Label text="Minute:" />
    <mx:NumericStepper id="minute" minimum="0" maximum="59" change="updateDisplay()" />
    <mx:Button label="Clear" click="resetDisplay()" />
    
    </mx:HBox>
    

    In my application, I added the xmlns:cust="components.*" in the declaration tag, and inserted one <cust:myCustomDateFeild id="myDate" />. I was able to access the entry in the parent by using {myDate.dateTime}.

    I made a few design assumption that you may decide to change, like the formatter, and I replaced your combo boxes with NumericStepper.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would find out the floppy inserted state : no floppy inserted unformatted floppy
I inserted some values into a table. There is a column whose value is
If user input is inserted without modification into an SQL query, then the application
I'm trying to fetch the last inserted row Id of a Sqlite DB in
How can I get the IDENTITY of an inserted row? I know about @@IDENTITY
How to customize the color of the symbol inserted in the glasses mode in
What's the best way to get the last inserted id using sqlite from Java?
Is there some way to get a value from the last inserted row? I
How do I track or get notified whenever a record is inserted or updated
I have a basic HTML form that gets inserted into a server side div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.