Date/Time Picker Output Help

In my Flex 3.6 app, I have a set of controls that allow the user to pick the date/time.  The user does this by selecting a date from a DateInput, an hour, minutes and AM/PM through three ComboBox.  I then combine the selections into a string and output in a Label control.
I now need to compare the date/time selected to a set of date/times that are allowed.  I keep running into the error "1067: Implicit coercion of a value of type String to an unrelated type Date."
How can I convert my date/time string into a valid date object so I can compare it with other date objects?
Thanks!
Lee
Below is the code:
DateTimePicker.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                                        layout="absolute"
                                        minWidth="955"
                                        minHeight="600">
          <mx:Script>
                    <![CDATA[
                              [Bindable]
                              private var todayDate:Date=new Date();
                              [Bindable]
                              private var earliestTime:Date=new Date(todayDate.getTime() + 3 * 60 * 60 * 1000);
                              [Bindable]
                              private var latestTime:Date=new Date(todayDate.getTime() + 12 * 60 * 60 * 1000);
                    ]]>
          </mx:Script>
          <!--Data-->
          <mx:XML id="hoursXML"
                              source="assets/hours.xml"/>
          <mx:XMLListCollection source="{hoursXML.hour}"
                                                              id="xmllcHours"/>
          <mx:XML id="minutesXML"
                              source="assets/minutes.xml"/>
          <mx:XMLListCollection source="{minutesXML.minute}"
                                                              id="xmllcMinutes"/>
          <mx:DateFormatter id="dfd"
                                                    formatString="MM/DD/YYYY"/>
          <mx:Label x="10"
                                y="10"
                                text="Date/Time"/>
          <mx:DateField x="82"
                                          y="10"
                                          id="dfExpectedDate"
                                          text="{dfd.format(todayDate)}"
                                          selectableRange="{{rangeStart: this.earliestTime,rangeEnd: this.latestTime}}"
                                          visible="true"
                                          width="100"/>
          <mx:ComboBox x="200"
                                         y="10"
                                         id="cbExpectedHour"
                                         fontWeight="normal"
                                         width="80"
                                         text="Hour"
                                         selectedIndex="-1"
                                         dataProvider="{xmllcHours}">
          </mx:ComboBox>
          <mx:ComboBox x="300"
                                         y="10"
                                         width="80"
                                         id="cbExpectedMinute"
                                         fontWeight="normal"
                                         selectedIndex="-1"
                                         text="Minute"
                                         dataProvider="{xmllcMinutes}">
          </mx:ComboBox>
          <mx:ComboBox x="400"
                                         y="10"
                                         width="80"
                                         id="cbExpectedTimeRange"
                                         fontWeight="normal"
                                         selectedIndex="-1"
                                         text="AM/PM">
                    <mx:ArrayCollection>
                              <mx:Object label="a.m."
                                                     data="AM"/>
                              <mx:Object label="p.m."
                                                     data="PM"/>
                    </mx:ArrayCollection>
          </mx:ComboBox>
          <mx:Text x="10"
                               y="38"
                               text="{this.dfExpectedDate.text} {this.cbExpectedHour.text}:{this.cbExpectedMinute.text}:00 {this.cbExpectedTimeRange.selectedItem.data}"
                               id="tExpectedLandingDateTime"
                               visible="true"/>
</mx:Application>
hours.xml
<?xml version="1.0" encoding="utf-8"?>
<hours>
          <hour>12</hour>
          <hour>01</hour>
          <hour>02</hour>
          <hour>03</hour>
          <hour>04</hour>
          <hour>05</hour>
          <hour>06</hour>
          <hour>07</hour>
          <hour>08</hour>
          <hour>09</hour>
          <hour>10</hour>
          <hour>11</hour>
</hours>
minutes.mxml
<?xml version="1.0" encoding="utf-8"?>
<minutes>
          <minute>00</minute>
          <minute>01</minute>
          <minute>02</minute>
          <minute>03</minute>
          <minute>04</minute>
          <minute>05</minute>
          <minute>06</minute>
          <minute>07</minute>
          <minute>08</minute>
          <minute>09</minute>
          <minute>10</minute>
          <minute>11</minute>
          <minute>12</minute>
          <minute>13</minute>
          <minute>14</minute>
          <minute>15</minute>
          <minute>16</minute>
          <minute>17</minute>
          <minute>18</minute>
          <minute>19</minute>
          <minute>20</minute>
          <minute>21</minute>
          <minute>22</minute>
          <minute>23</minute>
          <minute>24</minute>
          <minute>25</minute>
          <minute>26</minute>
          <minute>27</minute>
          <minute>28</minute>
          <minute>29</minute>
          <minute>30</minute>
          <minute>31</minute>
          <minute>32</minute>
          <minute>33</minute>
          <minute>34</minute>
          <minute>35</minute>
          <minute>36</minute>
          <minute>37</minute>
          <minute>38</minute>
          <minute>39</minute>
          <minute>40</minute>
          <minute>41</minute>
          <minute>42</minute>
          <minute>43</minute>
          <minute>44</minute>
          <minute>45</minute>
          <minute>46</minute>
          <minute>47</minute>
          <minute>48</minute>
          <minute>49</minute>
          <minute>50</minute>
          <minute>51</minute>
          <minute>52</minute>
          <minute>53</minute>
          <minute>54</minute>
          <minute>55</minute>
          <minute>56</minute>
          <minute>57</minute>
          <minute>58</minute>
          <minute>59</minute>
</minutes>

In my Flex 3.6 app, I have a set of controls that allow the user to pick the date/time.  The user does this by selecting a date from a DateInput, an hour, minutes and AM/PM through three ComboBox.  I then combine the selections into a string and output in a Label control.
I now need to compare the date/time selected to a set of date/times that are allowed.  I keep running into the error "1067: Implicit coercion of a value of type String to an unrelated type Date."
How can I convert my date/time string into a valid date object so I can compare it with other date objects?
Thanks!
Lee
Below is the code:
DateTimePicker.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                                        layout="absolute"
                                        minWidth="955"
                                        minHeight="600">
          <mx:Script>
                    <![CDATA[
                              [Bindable]
                              private var todayDate:Date=new Date();
                              [Bindable]
                              private var earliestTime:Date=new Date(todayDate.getTime() + 3 * 60 * 60 * 1000);
                              [Bindable]
                              private var latestTime:Date=new Date(todayDate.getTime() + 12 * 60 * 60 * 1000);
                    ]]>
          </mx:Script>
          <!--Data-->
          <mx:XML id="hoursXML"
                              source="assets/hours.xml"/>
          <mx:XMLListCollection source="{hoursXML.hour}"
                                                              id="xmllcHours"/>
          <mx:XML id="minutesXML"
                              source="assets/minutes.xml"/>
          <mx:XMLListCollection source="{minutesXML.minute}"
                                                              id="xmllcMinutes"/>
          <mx:DateFormatter id="dfd"
                                                    formatString="MM/DD/YYYY"/>
          <mx:Label x="10"
                                y="10"
                                text="Date/Time"/>
          <mx:DateField x="82"
                                          y="10"
                                          id="dfExpectedDate"
                                          text="{dfd.format(todayDate)}"
                                          selectableRange="{{rangeStart: this.earliestTime,rangeEnd: this.latestTime}}"
                                          visible="true"
                                          width="100"/>
          <mx:ComboBox x="200"
                                         y="10"
                                         id="cbExpectedHour"
                                         fontWeight="normal"
                                         width="80"
                                         text="Hour"
                                         selectedIndex="-1"
                                         dataProvider="{xmllcHours}">
          </mx:ComboBox>
          <mx:ComboBox x="300"
                                         y="10"
                                         width="80"
                                         id="cbExpectedMinute"
                                         fontWeight="normal"
                                         selectedIndex="-1"
                                         text="Minute"
                                         dataProvider="{xmllcMinutes}">
          </mx:ComboBox>
          <mx:ComboBox x="400"
                                         y="10"
                                         width="80"
                                         id="cbExpectedTimeRange"
                                         fontWeight="normal"
                                         selectedIndex="-1"
                                         text="AM/PM">
                    <mx:ArrayCollection>
                              <mx:Object label="a.m."
                                                     data="AM"/>
                              <mx:Object label="p.m."
                                                     data="PM"/>
                    </mx:ArrayCollection>
          </mx:ComboBox>
          <mx:Text x="10"
                               y="38"
                               text="{this.dfExpectedDate.text} {this.cbExpectedHour.text}:{this.cbExpectedMinute.text}:00 {this.cbExpectedTimeRange.selectedItem.data}"
                               id="tExpectedLandingDateTime"
                               visible="true"/>
</mx:Application>
hours.xml
<?xml version="1.0" encoding="utf-8"?>
<hours>
          <hour>12</hour>
          <hour>01</hour>
          <hour>02</hour>
          <hour>03</hour>
          <hour>04</hour>
          <hour>05</hour>
          <hour>06</hour>
          <hour>07</hour>
          <hour>08</hour>
          <hour>09</hour>
          <hour>10</hour>
          <hour>11</hour>
</hours>
minutes.mxml
<?xml version="1.0" encoding="utf-8"?>
<minutes>
          <minute>00</minute>
          <minute>01</minute>
          <minute>02</minute>
          <minute>03</minute>
          <minute>04</minute>
          <minute>05</minute>
          <minute>06</minute>
          <minute>07</minute>
          <minute>08</minute>
          <minute>09</minute>
          <minute>10</minute>
          <minute>11</minute>
          <minute>12</minute>
          <minute>13</minute>
          <minute>14</minute>
          <minute>15</minute>
          <minute>16</minute>
          <minute>17</minute>
          <minute>18</minute>
          <minute>19</minute>
          <minute>20</minute>
          <minute>21</minute>
          <minute>22</minute>
          <minute>23</minute>
          <minute>24</minute>
          <minute>25</minute>
          <minute>26</minute>
          <minute>27</minute>
          <minute>28</minute>
          <minute>29</minute>
          <minute>30</minute>
          <minute>31</minute>
          <minute>32</minute>
          <minute>33</minute>
          <minute>34</minute>
          <minute>35</minute>
          <minute>36</minute>
          <minute>37</minute>
          <minute>38</minute>
          <minute>39</minute>
          <minute>40</minute>
          <minute>41</minute>
          <minute>42</minute>
          <minute>43</minute>
          <minute>44</minute>
          <minute>45</minute>
          <minute>46</minute>
          <minute>47</minute>
          <minute>48</minute>
          <minute>49</minute>
          <minute>50</minute>
          <minute>51</minute>
          <minute>52</minute>
          <minute>53</minute>
          <minute>54</minute>
          <minute>55</minute>
          <minute>56</minute>
          <minute>57</minute>
          <minute>58</minute>
          <minute>59</minute>
</minutes>

Similar Messages

  • Javascript Date & Time Picker

    Hi,
    I would like to create an event on a text field, when you click on it it's calling a javascript function to popup a date & time picker.
    Is anyone can help me ?
    Eric . Thanks

    Eric,
    I don't think this is such a good idea. However, you can do that by using the javascript
    ApEx is using:
    &lt;script type="text/javascript">
    function f_popup_date(p_this)
       var value_exists = $x(p_this).value
       var item_name = $x(p_this).name
       var app_id = &APP_ID.
       var sec_gr_id = $x('P_SECURITY_GROUP_ID').value
       if (value_exists &lt;= '')
           w = open("wwv_flow_utilities.show_as_popup_calendar" +
                       "?p_element_index=" + escape(item_name) +
                       "&p_form_index=" + escape('0') +
                       "&p_date_format=" + escape('DD-MON-RR') +
                       "&p_bgcolor=" + escape('#666666') +
                       "&p_dd=" + escape('') +
                       "&p_hh=" + escape('') +
                       "&p_mi=" + escape('') +
                       "&p_pm=" +
                       "&p_yyyy=" + escape('2008') +
                       "&p_lang=" + escape('en') +
                       "&p_application_format=" + escape('N') +
                       "&p_application_id=" + escape(app_id) +
                       "&p_security_group_id=" + escape(sec_gr_id) +
                       "&p_mm=" + escape('01'),
                       "winLov",
                       "Scrollbars=no,resizable=yes,width=258,height=210");
           if (w.opener == null)
             w.opener = self;
           w.focus();
    &lt;/script>Create a hidden item on your page
    P_SECURITY_GROUP_ID
    with a source pl/sql expression or function
    htmldb_custom_auth.get_security_group_id
    In your item HTML Form Element Attributes put the following
    onclick="javascript:f_popup_date(this);"
    and it should work like in my example here:
    http://htmldb.oracle.com/pls/otn/f?p=31517:68
    You will also need to take care of the other variables
    like the current year, language and the date format.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/apex/f?p=107:7
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Date time picker script does not look right when calender pops up

    When I use this script in my header, my date time picker does not look right.  The pop up calender works but the layout is off,  here is the code I am adding to my header:
    <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
        <link rel="style.css" type="text/css" media="screen"
         href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min .css">
    And here is the code I am adding to the body of the html page below: Is it the placement of the code in the header? I've tried the beginning and the end of the hearder but no difference.  Thanks for your time on this....
    <div id="datetimepicker" class="input-append date">
    <input type="text"></input>
    <span class="add-on">
    <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
    </span>
    </div>
    <script type="text/javascript"
    src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js">
    </script>
    <script type="text/javascript"
    src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js">
    </script>
    <script type="text/javascript"
    src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min. js">
    </script>
    <script type="text/javascript"
    src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.pt-B R.js">
    </script>
    <script type="text/javascript">
    $('#datetimepicker').datetimepicker({
    format: 'MM/dd/yyyy hh:mm:ss',
    language: 'en'
    </script>

    Page is not up yet, can I attach the html to this forum?  I'l cut and paste the html below, thanks
    <!DOCTYPE html>
    <!-- Consider specifying the language of your content by adding the `lang` attribute to <html> -->
    <!--[if lt IE 7]> <html class="no-js ie6"> <![endif]-->
    <!--[if IE 7]>    <html class="no-js ie7"> <![endif]-->
    <!--[if IE 8]>    <html class="no-js ie8"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
    <!-- this is the header code for the date/time picker-->
      <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
        <link rel="style.css" type="text/css" media="screen"
         href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min .css">
          <!-- to here-->
        <meta charset="utf-8">
        <!-- Always force latest IE rendering engine & Chrome Frame -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <!-- Put your title here! -->
        <title>Hawaii Beach Weddings</title>
        <meta name="description" content="">
         <!-- Mobile viewport optimized: j.mp/bplateviewport -->
        <meta name="viewport" content="width=device-width">
        <link href="style.css" rel="stylesheet">
        <!-- Load Open Sans and Merriweather from Google Fonts
            For optimal performance, customize it to load the styles you need:
            http://goo.gl/QufgJ
        -->
        <link href="//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700|Merriweathe r:400,700,900" rel="stylesheet">
        <!-- All JavaScript at the bottom, except for Modernizr
            Modernizr enables HTML5 elements & feature detects; It includes Respond, a polyfill for min/max-width CSS3 Media Queries
            For optimal performance, use a custom Modernizr build: www.modernizr.com/download/ -->
            <script src="js/modernizr-2.6.1.min.js"></script>
        <script src="js/modernizr-2.6.1.min.js"></script>
    </head>
    <body>
        <!-- Prompt IE 6 and 7 users to install Chrome Frame:        chromium.org/developers/how-tos/chrome-frame-getting-started -->
        <!--[if lt IE 8]>
            <p class="chromeframe alert alert-warning">Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p>
        <![endif]-->
        <header id="master-header" class="clearfix" role="banner">
            <hgroup>
                <h1 id="site-title"><a href="index.html" title="Your Site Name">Hawaii Beach Weddings</a></h1>
                <h1 id="site-title2"><a href="index.html" title="Your Site Name">xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</a></h1>
                <h2 id="site-description">Where the Sun, Sand and Love come together...</h2>
            </hgroup>
        </header> <!-- #master-header -->
    <div id="main" class="row">
        <!-- Main navigation -->
        <nav class="main-navigation span12 clearfix" role="navigation">
            <h3 class="assistive-text">Main menu</h3>
            <ul>
                <li><a href="index.html">Home</a></li>
                <li class="current">
                    <a href="about.html">About</a>
                    <ul class="sub-menu">
                        <li><a href="http://www.google.com">Subpage 1</a></li>
                        <li><a href="#">Subpage 2</a></li>
                    </ul>
                </li>
                <li><a href="contact.html">FAQ's</a></li>
            </ul>
        </nav> <!-- #main-navigation -->
    <div id="content" role="main" class="span12">
        <article class="page hentry">
            <header class="entry-header">
                <h1 class="entry-title">Simple Beach Weddings</h1>
            </header> <!-- .entry-header -->
            <div class="entry-content">
                <p>We specialize in simplicity for your beach wedding.  Let us keep it simple by offering what you need to make your beach wedding easy </p>
                <!-- Typography
                ================================================== -->
                <section id="typography">
                    <h1>I am first a photographer who loves to<small></small>capture &quot;the moment.&quot;</h1>
                    <p>By organizing Hawaii Beach Weddings, I have allowed myself to do what I do best: capture your moment. I use industry professionals to make a sometimes stressful event easy. By keeping it to a few simple choices: A Minister (necessary), Flowers, Music, Video, Chairs (optional), I have allowed you to quickly design your wedding event and enjoy your stay in the islands. </p>
                        <div class="row">
                            <div class="span7">
                                <h2>Ministers:</h2>
                                <h3>Reverand Robert Hoyt</h3>
                                                <p> </p>
                            </div>
                    </div>
                      <h2> </h2>
                        <div class="row"></div>
                        <div class="row">
                  </div>
                    <h2> </h2>
                </section>
                <section id="tables">
                  <div class="row">
                  </div> <!-- .row -->
                </section> <!-- #tables -->
                <!-- Forms
                ================================================== -->
                <section id="forms">
                    <h1>Let's begin with your contact information.</h1>
                    <form class="row">
                        <fieldset class="span5">
                          <p>
                            <label>Name
                              <input type="text" required></label></p>
                              <br>
                              <p><label>Phone number with area code <input type="text" pattern="\d{5}(-\d{4})?" title="a US Zip code, with or without the +4 exension" placeholder=" 123-456-7891"></label></p>
                              <br>
                              <p>
                              <label>Email
                              <input type="email"></label></p>
                              <br>
                              <h1>Where would you like your wedding to be?</h1>
                 <p><label>Honolulu (South Oahu)<input type="radio" name="rad"></label></p>
                 <p><label>Waimanalu (East Oahu) <input type="radio" name="rad"></label></p>
                    <br>     
                    <h1>What date & time would you like to have your wedding?</h1>
                     <!--This is the date/time picker-->
                          <div id="datetimepicker" class="input-append date">
          <input type="text"></input>
          <span class="add-on">
            <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
          </span>
        </div>
        <script type="text/javascript"
         src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js">
        </script>
        <script type="text/javascript"
         src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js">
        </script>
        <script type="text/javascript"
         src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min. js">
        </script>
        <script type="text/javascript"
         src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.pt-B R.js">
        </script>
        <script type="text/javascript">
          $('#datetimepicker').datetimepicker({
            format: 'MM/dd/yyyy hh:mm:ss',
            language: 'en'
        </script>
        <br>
                         <h1>What type of flowers would you like to have?</h1>
                         <p>
                                <label>Bouquet<br>
                                    <select>
                                        <option>None</option>
                                        <option>Red roses</option>
                                        <option>White roses</option>
                                        <option>Hibiscus</option>
                                    </select>
                                </label>
                            <p>
                                <label>Flowers<br>
                                    <select>
                                        <option>None</option>
                                        <option>Roses</option>
                                        <option>Orchids</option>
                                        <option>Hibiscus</option>
                                    </select>
                                </label>
                                  <h1>What type of Leis would you like to have?</h1>
                                <label>Leis<br>
                                    <select>
                                        <option>None</option>
                                        <option>Kukui nut (male)</option>
                                        <option>Orchids (inexpensive)</option>
                                        <option>Stephanotus (sweet smelling</option>
                                    </select>
                                </label>
    </fieldset>
    <fieldset class="span4">
                          <p>
                           <!--this is the chair number selector-->
                            <p>
                               <label>Music<br>
                                    <select>
                                        <option>None</option>
                                        <option>solo singer with ukulele</option>
                                        <option>solo singer with guitar</option>
                                        <option>solo guitar instrumental</option>
                                        <option>small ensemble</option>
                                    </select>
                                </label>
                              <br>
                              <label for="s">Number of Chairs</label><p>
                                <select id="s">
                                    <option>none</option>
                                    <option>1</option>
                                    <option>2</option>
                                    <option>3</option>
                                    <option>4</option>
                                    <option>5</option>
                                    <option>6</option>
                                    <option>7</option>
                                    <option>8</option>
                                </select>
                            </p>
                            <p>
                              <label for="t">Notes</label> <textarea id="t" cols="30" rows="5">Textarea text</textarea></p>
                        </fieldset>
                <!-- Miscellaneous
                ================================================== --><!-- #miscellaneous -->
            </div> <!-- .entry-content -->
        </article> <!-- .post.hentry -->
    </div> <!-- #content -->
    </div> <!-- #main -->
        <footer id="footer" role="contentinfo">
            <!-- You're free to remove the credit link to Jayj.dk in the footer, but please, please leave it there -->
        </footer> <!-- #footer -->
        <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script>window.jQuery || document.write('<script src="js/jquery-1.7.2.min.js"><\/script>')</script>
        <!-- Load custom scripts -->
        <script src="js/script.js"></script>
    </body>
    </html>

  • Date/Calendar picker-- please help

    Hello
    Would someone please help me out? I am trying to get the date picker from the demo below.
    http://www.toedter.com/en/jcalendar/demo.html
    However, I have a JButton in my short program. Once I click on the JButton, I need the calendar to show just as it does w/ the first icon in the demo.
    According to the documentation calling JDateChooser() would make the calendar visible. I have installed the package on my machine.
    In my code when I click on the button, nothing happens.
    import java.awt.Dimension;
    import java.awt.GridBagConstraints;
    import java.awt.GridBagLayout;
    import java.awt.Insets;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextField;
    //import com.toedter.calendar.JDateChooser;
    public class program1 extends JFrame
      private static final long serialVersionUID = 1;
      static JFrame frame = new JFrame();
      static JButton B1 = null;
      static JTextField tfDateTime = new JTextField(30);
      public static void main(String args[])
        frame.setTitle("JCalendar");
        JPanel mainPanel = new JPanel();
        JScrollPane scrollPane = new JScrollPane(mainPanel);
        //ImageIcon img = Utility.loadIconByName("/images/JCalendarColor32.gif");
        B1 = new JButton();
        mainPanel.setLayout(new GridBagLayout());
        GridBagConstraints a = new GridBagConstraints();
        a.insets = new Insets(0, 10, 8, 0);               //1. Date/Time label and TextField
        a.gridx = 0;
        a.gridy = 1;
        a.anchor = GridBagConstraints.WEST;
        mainPanel.add(new JLabel("1. Date/Time:"), a);
        a.gridx = 1;                           
        mainPanel.add(tfDateTime, a);
        a.gridx = 2;         
        B1.addActionListener(new java.awt.event.ActionListener()
          public void actionPerformed(final java.awt.event.ActionEvent e)
            JDateChooser D = new JDateChooser();
        mainPanel.add(B1, a);
        frame.add(scrollPane);
        frame.setSize(new Dimension(700,200));
        frame.setLocation(200,200);
        frame.setVisible(true);
    }I am reading the doc and the JDateChooser() and still can't figure out how to make this work.
    How can I get the calendar to show when i click on the JButton (B1) in my code. Would someone please please help me out ?
    Thanks in advance

    Nevermind, please do ignore this posting.

  • Date/time-operations - need help

    Hi there,
    I have a simple question but i don't have really good ideas to solve the problem with ABAP.
    This is the situation in which I need help:
    I have many date/time-pairs (every in a single variable of type d and t). Now I want to compare one date/time-pair with a given date (also as pair). This will give a time difference between the two dates.
    After that I want that all other date/time-pairs are shifted by this time difference (can be + and -).
    So now my solution yet:
    * FORM for calculation the time difference between 2 dates
    FORM idoc_compare_dates  USING    iv_date_orig
                                      iv_time_orig
                                      iv_date_new
                                      iv_time_new
                             CHANGING cv_diff       TYPE p.
      DATA: lv_timestamp_orig    TYPE timestamp,
            lv_timestamp_new     TYPE timestamp.
    * Creating timestamps for comparison
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
      CONVERT DATE iv_date_new TIME iv_time_new
        INTO TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo.
    * Calculation the time difference
      cv_diff = lv_timestamp_new - lv_timestamp_orig.
    ENDFORM.                    " IDOC_COMPARE_DATES
    * FORM for shifting a date by the time period calculated in the first FORM
    FORM idoc_calc_single_date  USING    iv_diff      TYPE p
                                         iv_date_orig
                                         iv_time_orig
                                CHANGING cv_date_new
                                         cv_time_new.
      DATA: lv_timestamp_orig   TYPE timestamp,
            lv_timestamp_new    TYPE timestamp.
    * Creating a timestamp for the original date
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
    * Shifting the date
      lv_timestamp_new = lv_timestamp_orig + iv_diff.
    * Creating the new date into the output-variables
      CONVERT TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo
        INTO DATE cv_date_new TIME cv_time_new.
    ENDFORM.                    " IDOC_CALC_SINGLE_DATE
    I am not sure if this coding above is really correct. Can you please check it? Perhaps you have also other ideas to solve this problem?
    Thank you!!
    Kind regards

    Thank you for your answers. Now I've created a small dummy-report, that tests the logic. And I think it seems to be okay.
    You can also check it if you want to with this small report:
    REPORT  zjz_test_timediff.
    PARAMETERS: p_dat1  TYPE sydatum DEFAULT sy-datum,
                p_zei1  TYPE syuzeit DEFAULT sy-uzeit,
                p_dat2  TYPE sydatum DEFAULT sy-datum,
                p_zei2  TYPE syuzeit DEFAULT sy-uzeit.
    SELECTION-SCREEN: SKIP 2.
    PARAMETERS: p_diff type p.
    SELECTION-SCREEN: SKIP 2.
    PARAMETERS: p_dat3  TYPE sydatum,
                p_zei3  TYPE syuzeit.
    DATA: lv_timestamp_orig   TYPE timestamp,
          lv_timestamp_new    TYPE timestamp,
          lv_diff             TYPE p.
    AT SELECTION-SCREEN.
      PERFORM idoc_compare_dates USING p_dat1
                                       p_zei1
                                       p_dat2
                                       p_zei2
                              CHANGING p_diff.
      PERFORM idoc_calc_single_date USING p_diff
                                          p_dat1
                                          p_zei1
                                 CHANGING p_dat3
                                          p_zei3.
    *&      Form  IDOC_COMPARE_DATES
    FORM idoc_compare_dates  USING    iv_date_orig
                                      iv_time_orig
                                      iv_date_new
                                      iv_time_new
                             CHANGING cv_diff       TYPE p.
      DATA: lv_timestamp_orig    TYPE timestamp,
            lv_timestamp_new     TYPE timestamp.
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
      CONVERT DATE iv_date_new TIME iv_time_new
        INTO TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo.
      cv_diff = lv_timestamp_new - lv_timestamp_orig.
    ENDFORM.                    " IDOC_COMPARE_DATES
    *&      Form  IDOC_CALC_SINGLE_DATE
    FORM idoc_calc_single_date  USING    iv_diff      TYPE p
                                         iv_date_orig
                                         iv_time_orig
                                CHANGING cv_date_new
                                         cv_time_new.
      DATA: lv_timestamp_orig   TYPE timestamp,
            lv_timestamp_new    TYPE timestamp.
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
      lv_timestamp_new = lv_timestamp_orig + iv_diff.
      CONVERT TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo
        INTO DATE cv_date_new TIME cv_time_new.
    ENDFORM.                    " IDOC_CALC_SINGLE_DATE

  • Clock incorrect, and adjusting in Date & Time doesn't help

    I have corrected this in date and time by updating the timezone and even manually setting the clock, but the time displayed by my computer is still based on the GMT timezone for some reason.  Thank you for your help. 

    I'm using Snow Leopard, but I'm assuming it's in the same location. Enter /private/etc in Go>Go to Folder in the Finder menu, then scroll down to localtime.
    localtime on mine appears to be an alias to /usr/share/zoneinfo. If I right-click Show Original on the alias localtime, I see that mine is set to New York in the zone America. Your localtime apears to be locked and doesn't allow you to make this change.
    So try this, which should unlock localtime. Copy/paste the following command into Terminal in Utilities, then hit return. You will be asked for your admin password, which you won't see anywhere when you type it in, and hit return again.
    sudo chflags nouchg /private/etc/localtime
    Now try setting the time preference.
    If this doesn't do it, one or two more steps may be required.

  • Oracle Interval and Date/Time Conversions. Help!

    Hi guys.
    I am trying to migrate from MySql to Oracle some queries, but I don't know how works some SQL functions in Oracle.
    One of my queries I have to add to a date variable an amount of microseconds, seconds or minutes, in mysql the function is like this:
    DATE_FORMAT(LOCALDATE + INTERVAL DeltaT * 1000 MICROSECOND , '%d/%m/%Y %H:%i')
    I woud like also convert seconds, minutes, or hours to a Time variable, my example in mysql is like this:
    TIME_FORMAT(SEC_TO_TIME(DeltaT div 1000),'%H:%i')
    By the way: DeltaT is in seconds and LOCALDATE is a date variable.
    I hope you can help me with this.
    Thanks.

    SQL> CREATE TABLE t (localdate DATE, deltat INTEGER);
    Table created.
    SQL> INSERT INTO t VALUES (DATE '2006-12-25', 1234);
    1 row created.
    SQL> INSERT INTO t VALUES (DATE '2006-12-25', 23456);
    1 row created.
    SQL> alter session set nls_date_format = 'DD-MON-RRRR HH24:MI:SS';
    Session altered.
    SQL> SELECT localdate
      2       , deltat
      3       , localdate + deltat/86400
      4  FROM   t;
    LOCALDATE                DELTAT LOCALDATE+DELTAT/864
    25-DEC-2006 00:00:00       1234 25-DEC-2006 00:20:34
    25-DEC-2006 00:00:00      23456 25-DEC-2006 06:30:56
    2 rows selected.

  • Crystal XI Date Time Picker

    <p>Hi Friends,</p><p>I have created a Datetime Parameter in Crystal XI ,But when I run the report It just allows me to select Date  their is no Time Part  in it. In previous versions of Crystal You were able to select the Time Also.</p><p>Any ideas????????</p><p>Thanks</p><p>Rahul</p>

    When I add a DateTime parameter, it only provides buttons for the date. However the text says "Please enter DateTime in format "yyyy-mm-dd hh:mm:ss", and after I have entered the date then there is info like that that allows you to enter a time "2007-3-17 00:00:00"
    Also looks like there is another parameter just for time, this once again doesn't have any buttons, but takes keystroke input for hh:mm.ss.
    Hope this helps.
    Rody

  • Microsoft Date and Time Picker Control 6.0 - Need help!

    I am working on a form in Office 365 Excel 2013 that uses the Microsoft Date and Time Picker Control 6.0.  When I set the form up last week, this Active X control was working perfectly.  The weekend goes by...and now it's not working at all? 
    My PC is 64 bit.  I believe my version of Office is also 64 bit.  When I researched this issue online, I found lots of people who indicated that this control was missing in their development kit.  It was and has always been available in mine
    (i.e. I didn't have to load an MSCOMCT2 file).  Further, this control WAS WORKING when I created it last week.  Now it is not, even though no changes have been made to it.  I can place the control on the sheet and even set properties for it. 
    But once I click out of Design Mode, it is not functioning.  It doesn't open or respond to any clicks on it. 
    Can anyone help me identify a reason why it may have suddenly stopped working?  I don't think it is macro-related because I have a 'Clear Form' button on the same page and it works just fine.
    UPDATE:  I've noticed something else peculiar but relevant.  My office 365 just did some updates.  When updates were completed, it auto-reopened my file.  I noticed that the Date/Time Picker button looked funny (really pixelated). 
    So I hit 'Design Mode' and resized it.  After I exited 'Design Mode,' it started working again.  I tested it, along with my 'Clear Form' button multiple times.  It seemed to be working fine.  I closed the document and reopened it. 
    Enabled Macros.  When I tried to use it after reopen, it doesn't work again.  Won't respond to ANY attempts to click on it. I can click on 'Design Mode' and it sees the control, edits properties, etc.  But when you click out of 'Design Mode,'
    it's a dead button again.  I also went to someone else's desk to test this form.  Same problem.  Date/Time picker button doesn't work, even after enabling macros.  The Clear Form Button has no problems though.
    Thanks!

    Hi,
    Would you like to tell me your Excel version number (Go to Account>About Excel). I tested in my version :15.0.4569.1504 and the Date and Time Picker Control 6.0 still could be used.
    Then,>> My PC is 64 bit.  I believe my version of Office is also 64 bit.<<  Office 2013 32 bit also could be installed in 64bit operation system. We could check it with Account>About Excel.
    Next, as you said >>After I exited 'Design Mode,' it started working again.  I tested it, along with my 'Clear Form' button multiple times.  It seemed to be working fine.  I closed the document and reopened it.  Enabled Macros. 
    When I tried to use it after reopen, it doesn't work again.<< 
    I recommend we recreate a new blank Excel file and insert the Date and Time Picker Control 6.0 to test.
    If it still does not work well, please try to reinstall and re-registry it. Follow the link:
    https://social.msdn.microsoft.com/Forums/office/en-US/36f83f24-cd76-4f8e-aa7b-5f166666e7d3/excel-2013-popup-calendar
    https://social.msdn.microsoft.com/Forums/en-US/91cf3127-70fe-4726-8a27-31b8964430c5/registering-mscomct2ocx-in-64-bit-windows-7?forum=sbappdev
    If it works well, I suppose this issue is related to macros. I recommend you post the question to MSDN forum to debug them:
    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=exceldev
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Get Sale order created date & time

    Hello.
        Can anybody help me in finding the function module which takes sale order no. as input & gives me the order created date & time as output.
    Regards
    Devika.S

    In Table VBAK,  you can see both these fields
    1)  ERDAT:::::Created date
    2)  ERZET::::::Created time
    thanks
    G. Lakshmipathi

  • In Sharepoint browser enabled Infopath form Date & Date Time Pickers throws Script errors using https url.

    HI All,
    I am working in Sharepoint 2010 browser enabled Infopath form and is have two Infopath date picker controls. The form is working fine in normal "http://" url. while the same site we are using opening with "https://" and select the date
    from picker then we got the script errors.
    There are no scripts used in this site. It is by default sharepoint 2010 publishing site.
    One more i checked with "Date Time picker" Infopath control also but same issue.
    Below are the errors for reference:-
    Any help is appreciated..!
    Thanks.

    Thanks Linda, for your quick response.
    The  Minimal
    Download strategy  feature is not available
    in SharePoint 2010 and start.js file is also not available.
    can you please suggest the exact location of "start.js"
    file in SharePoint 2010 then i go further or please suggest other way to find or debug the process.

  • Difference between LV 6.1 and LV 7.0 - Date\Time Format

    I found different behviour of numeric controls in Date/Time format, or
    in "Seconds to Date\Time String" function in LV6.1 and LV7.0
    In LV 6.1:
    Absolute time in seconds is formated in control with date/time format,
    output depends on local time format on computer, where this VI runs.
    So if I start LabView on machine with specific time zone, and for
    example DST on, the output was changed by these settings. ANY number
    of second is handled by this settings.
    In LV 7.0:
    Output still depends on specific time zone, but the use of the DST
    on/off depends on absolute time value. So if the number represents
    absolute time which fits period when DST was off, the output is
    wihtout DST, even if the DST is on when this vi runs.
    The solution in LV 7.0 is much more better than in LV 6.1, but ...
    If data are measured and stored (store of absoulte time DBL) in one
    time zone, and if they are processed in different time zone (for
    exapmle where DST change is in different time), the data
    representation is wrong.
    In LV 6.1 it was not correct too, but anyway there was a way how to
    solve this problem:
    I stored absolute time DBL and GMT delta for every time stamp. When I
    process this stored data on different computer with different time
    zone, I recalculate time stamps in this way:
    absolute time + stored GMT delta - GMT delta of computer where data
    are presented.
    So in final I have correct time does not matter on time zone or any
    other settings which are on computer where are data presented.
    But on LV 7.0, the GMT delta is not constant for every data and this
    algorithm is useless. I can simply show correct time when data are
    from same time zone without any calculation, but it is almost
    imposible to correct show data
    from different time zone.
    My question is:
    Is there any "ini file item", which can tell LabView 7.0 to use time
    representation style as in LV 6.1 ?
    Thank you and best regards
    Jiri Hula

    Thanks for the well written question.
    Unfortunately, there is no ini token or any way of specifying LabVIEW use the LV 6.1 style.
    I am attaching a LabVIEW 7.0 VI that calculates the UTC Offset for a given time value (I don't think the same code would work correctly in LabVIEW 6.1). The VI comments are:
    The attached VI will take Daylight Saving and Time zone into account to compute the offset in seconds from UTC Time to the Local time (as specified by the computer). Note: This VI can aid in converting from Local Time to UTC time, but not in converting from one Timezone to another.
    I hope it helps. Basically, your data is in UTC (absolute time) as it has always been, but LabVIEW 7.0 changed the way it displays the UTC data (trying to be more correct). If you wish to display it the way it was in LabVIEW 6.1, things are going to get a little tricky. LabVIEW 6.1 displayed the same DBL absolute time differently depending on if the current computer time was in DST or not. To get this behavior in LabVIEW 7.0, the equation:
    absolute time + stored GMT delta - GMT delta of computer where data are presented
    is still correct, but for LabVIEW 7.0 the GMT deltas now vary depending on whether the absolute time is in DST or not. It may be possible to convert the GMT offset you have saved from LabVIEW 6.1 into a set or pair of UTC Offsets. This would require a knowledge of what the DST state was for each of the data points in question.
    The DST state or GMT/UTC offset that the computer currently is using may be obtained from the attached VI.
    The absolute time is stored in GMT/UTC so that in different time zones it will still equate to the same time, even though it will be displayed differently. Another data format (such as storing the Hour, Minute, Second, Day, Month, Year; or storing the date as a string) might be more appropriate if the time should be displayed as the same local time regardless of the time zone.
    I hope this helps. Please respond if you have any comments or questions.
    Shawn Walpole
    Attachments:
    GetUTCOffset.vi ‏52 KB

  • Sent Date/Time is not appearing in mail from Portal

    Hi All
    We have configured portal to send email. The functionality works perfectly fine except for a small problem. We get sent field as None in the email. Is there any setting/configuration required to display sent date/time ?
    Any help will be appreciated.
    Best Regards
    Prabhakar Lal

    Hello Prabhakar lal,
    My client new requirement to configure the SMTP in portal.., i saw u r relevant thread. I think you done the configuration in portal, could you please send me the step by step configuratipn details to my personal email: [email protected]
    Thanks in advance
    sreddhar g

  • Sum Date Time data type

    hello,
    In rdlc report i need to sum the date time datatype .
    please help .
    thanks.

    Hi Krishnakumar_Dev,
    If we want to extract hour in a date time field, we can use hour function as below in Reporting Services.
    =sum(hour(Fields!date.Value))
    Besides, if this issue is still existed, Could you please post the screenshot about your dataset with sample data and desired result?
    For more information about Date and Time Functions, please refer to the following link:
    http://technet.microsoft.com/en-us/library/aa337153(v=sql.100).aspx
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Identify Jobs that are not running on their Scheduled date time

    I have 29 scheduled jobs that run at different intervals of time. Some run once a day. few others run on hourly basis while others run on Sundays.
    I was working on a query that would let me know if a particular job did not run on its scheduled date and time.
    SELECT * from all_scheduler_jobs WHERE state <>'DISABLED'; will give me a list of all jobs that I have to monitor and that are not in the disabled state. But how can I verify that the jobs are running at their scheduled date time?
    Any help please? I need to create a view of all such jobs and then plan to send an alert so that appropriate action can be taken and it is assured that all important jobs run as per schedule.
    Thanks.

    Hi,
    I can see 2 approaches.
    - for jobs that have run but ran very late you should query dba_scheduler_job_run_details and filter by the difference between req_start_date and actual_start_date
    - for jobs that should have run but shouldn't, query for DBA_SCHEDULER_JOBS jobs that are SCHEDULED where next_run_date is in the past
    Hope this helps,
    Ravi.

Maybe you are looking for

  • Output from Handling Units

    Hi Experts, we are printing Output Labels for Handling Units after saving a Shipment. Following case: User save a Shipment and all HU-Outputs are created. If the User delete this Shipment and create another one with another Delivery ID (withsame ****

  • Crystal reports in R/3

    Hi, Can someone tell me what transaction do we use to write crystal reports in SAP R/3 ? Thanks. Regards, Tushar.

  • Crystal Reports Variable Parameters

    I have a client attempting to build a sales report where it will pull the data from the previous week / month / quarter only.  For example, if I have a report that I run on Monday, then it will pull all the data from the last 7 days (so the from the

  • Filling the transparent color with a new color in an image

    Hi, I need to fill the transparent color of an imageicon with a new color. I tried building a filter, but i have no results. Here's my code: private static class TransparentColorFilter extends RGBImageFilter { private int transparentColor; private in

  • T420 and Dolby TrueHD / DTS HD Master Audio Passthroug​h / Bitstream

    I am having trouble getting Dolby TrueHD or DTS HD Master Audio to bitsream from my T420 and hopefully you guys can shed some light. Currently I am using a displayport->HDMI adapter to input into my Pioneer Elite vsx-21txh receiver which in turn outp