timestamp, without date picker

Hello

I change format.
TO_CHAR (SYSDATE, 'DD-MON-YYYY HH24')

I have hard time when I tried to hide the date picker.
One did before him?

Thanks in advance,

Sam

Sorry change - to a + in the interval of calculation

See you soon

Ben

Tags: Database

Similar Questions

  • Generate report with a date picker. Help, please

    Hello

    I'm building an interactive report which should display the records corresponding to the date picker.

    I'm going to pull a report emp_name and LOAD_DT.  LOAD_DT is a date column from table1.

    Select "emp_name," LOAD_DT from table1

    where LOAD_DT =: P44_PICK_A_DATE;

    I chose article page to submit P44_PICK_A_DATE

    When I choose a date, he gives no error data

    Help, please.

    Thank you

    KJ

    Bind variable in the APEX will behave as strings. I normally apply TO_DATE(:P1_MY_DATE) without the date format and rely on application session formats / align.

    In your case, it would be more efficient to

    where load_date = to_date(:P44_PICK_A_DATE)

    unless you do something specific with date formats, then you would be just details the to_date

    Keep in mind, this also applies to the numbers, it would be more explicit

    where id = to_number(:P1_ID)

    Which is related to why there is a function v() and nv().

  • Date Picker Widget doesn't do not model job pages created (copied)

    Hello

    I'm trying to put in place a form of PDF document for a customer using Adobe Acrobat Pro XI.  I have several fields of the date where I am wanting to use the router form Date Picker Widget (that has been downloaded and installed).  It works perfectly fine when it is just a page.  However, I use a model with a script that creates a copy of the first page activated by a button - ideally to allow users to create many pages however they want before any shipment.  The key code is as follows:

    var myTemplateArray = this.templates;

    myTemplate = myTemplateArray var [0];

    myTemplate.spawn (this.numPages, true, false);

    Get the name prefix field that Acrobat will automatically add the new fields

    var f_prefix = 'P' + (this.numPages - 1) + ".cvcIntake";

    Reset the newly created fields

    this.resetForm ([f_prefix]);

    Go to the new page

    this.pageNum = this.numPages - 1;

    The problem starts when a new page is added.  If I try to click on the datePicker on the second page, it appears on the first page next to the very field that was copied.  And if a date is enabled it is entered in the field on the first page.

    Looking at what goes wrong, I found several things.  First, the aspect of naming in the copied page creates all objects in calendar with the prefix 'P1.cvcIntake.fld' ('fld' is the prefix of the fields on form on the first page).  Second, go to the properties of the date picker control object, its name was changed to 'P1.cvcIntake.FR_00000_CALENDARBUTTON_fld. Start_date"and this code of the action is:

    FormRouter_PlaceCalendar (getField ("FLD. (Start_date"), 3, 'yyyy-mm-dd", 18.61102294921875);

    Obviously the name and the action code will get him to do what he does now.  Unfortunately I do not know what to try to fix things, that my ability to write code to Acrobat is probably just a bit better than the beginners.  It seems to me that I need to use a completely different approach for this part.  Does anyone have advice on how I might be able to handle this problem?

    Thank you for your time and consideration,

    Mike

    It took a while for me to solve this problem, but there are even more time to post here (my apologies to all those who are looking for a solution for it before now).  Anyway, the real thing for me has been to discover that I didn't have to explicitly numbering ratings after adding new fields (such as ' # ' + this.pageNum)-it turns out that the numbering of appropriate rating is handled automatically.

    While I don't know the real pros out there might be able to find lots of ways to handle some aspects better, here's the result of a great many hours of research, trial and error, and persistence.  Given the help that I received from this forum, I would be very happy if I could make a contribution that helps anyone with this problem.  If so, I'd be happy to hear from you!  In any case, if anyone has any comments or questions please let me know.

    Download templates in the table.

    var aTemplates = this.templates;

    myTemplate = aTemplates var [0];

    Rogue new form page to end using the page renaming.

    myTemplate.spawn (this.numPages, true, false);

    Download the name prefix field that Acrobat automatically adds the new page field.

    var fldNamePrefix = 'P' + (this.numPages - 1) + ".cvcIntake";

    Reset the fields newly created to be rid of all the data.

    this.resetForm ([fldNamePrefix]);

    Counter table for fields found calendar init.

    var calFldsCnt = 0;

    Table for the fields found unusable copied calendar.

    var aCvcIntakeCalFlds = [];

    var pageCnt = this.numPages - 1;

    Loop through all areas.

    for (var i = 0; i)

    var f = this.getField (this.getNthFieldName (i));

    var aNameSlice = f.name.split(".");

    Find that all copied calendar template-renamed fields and register names in the table.

    If ((aNameSlice [1] == "cvcIntake" && aNameSlice [2] == "FR_00000_CALENDARBUTTON_fld") |) ((aNameSlice [1] == "cvcIntake" && aNameSlice [2] == "FR_00000_Calendar"))) {

    aCvcIntakeCalFlds [calFldsCnt] = f.name;

    calFldsCnt ++;

    continue;

    Ignore the fields of model-renamed.

    } ElseIf (aNameSlice [1] == 'cvcIntake') {}

    continue;

    }

    Find other fields that buttons calaendar to create the copy of the new page.

    If (aNameSlice [0] == 'FR_00000_Calendar') {}

    var calFieldsName = aNameSlice [0] + '. ' + aNameSlice [1];

    var calField = this.addField (calFieldsName, f.type, pageCnt, f.rect);

    var t = this.getField (calFieldsName);

    Copy without function proprties of the calendar page 0 fields.

    for (var p in f) {}

    try {}

    If (typeof f [p]! = 'function') {}

    If (p! = 'name': p! = 'page' | p! = "rect" | p! = 'type') {}

    t [p] = f [p];

    }

    }

    } catch (e) {}

    }

    By default all to hidden.

    t.Display = display.hidden;

    Define the 'CalendarMonth' elements because they are on page 0.

    If (aNameSlice [1] == 'CalendarMonth') {}

    var aMonths = new Array (["January", "1"],)

    ['February', '2'],

    ['March', '3'],

    ['April', '4'],

    ["Can", "5"],

    ['June', '6'].

    ['July', '7'],

    ['Augustus', '8'],

    ['September', '9'],

    ['October', '10'],

    ['November', '11'],

    (["December", "12"]) ;

    t.setItems (aMonths);

    }

    Copy button captions.

    If (f.type = 'button') {}

    t.buttonSetCaption (f.buttonGetCaption ());

    }

    Action game for all the "Day_X" of the calendar fields.

    If (calFieldsName.indexOf ("Day_") > 0) {}

    t.setAction ("MouseUp","FormRouter_SetCurrentDate (event.target.buttonGetCaption ());");

    }

    }

    Find calendar buttons page 0 and making new copies of the page.

    If (aNameSlice [0] == 'FR_00000_CALENDARBUTTON_fld') {}

    var calButtonName = "FR_00000_CALENDARBUTTON_P" + pageCnt + ".." cvcIntake.fld.' + aNameSlice [1];

    var calButton = this.addField (calButtonName, f.type, pageCnt, f.rect);

    var t = this.getField (calButtonName);

    Copy without function proprties 0 calendar of page buttons.

    for (var p in f) {}

    try {}

    If (typeof f [p]! = 'function') {}

    If (p! = 'name': p! = 'page' | p! = "rect" | p! = 'type') {}

    t [p] = f [p];

    }

    }

    } catch (e) {}

    }

    Get the icon copy button.

    t.buttonSetIcon (f.buttonGetIcon ());

    Set up the name of the variable for the action of the button calling the activation of the calendar.

    var dateFieldName = pageCnt + 'P' + '. '. cvcIntake.fld.' + aNameSlice [1];

    t.setAction ("MouseUp", "FormRouter_PlaceCalendar (getField (" + "\" "+ dateFieldName +"-""+"), 1, \"mm\/dd\/yyyy\ ", 0);'");

    }

    }

    Go through the array of captured fields not in use a copy model calendar and buttons, deletion of page.

    for (i = 0; i<=aCvcIntakeCalFlds.length;>

    this.removeField (aCvcIntakeCalFlds [i]);

    }

    Go to the new page

    this.pageNum = pageCnt;

  • Query date picker display "No data found", works of SQLPlus

    I created 2 date picker points - P2_START_DATE and P2_END_DATE. I put the format of these of 'DD-MON-YYYY '.

    This is the query that I select the data based on the values of the selectors of dates:

    Select sample_date, reading of meter_data where sample_date between to_date(:P2_START_DATE,'DD-MON-YYYY') and to_date(:P2_END_DATE,'DD-MON-YYYY') order by sample_date;

    The P2_START_DATE is January 20, 2011 ', the P3_END_DATE is January 21, 2011'.

    The query returns "No data found" when it is run in the APEX, but when I run the present in SQLPlus on the host I get data:


    Select sample_date, reading of meter_data where sample_date between to_date('20-JAN-2011','DD-MON-YYYY') and to_date('21-JAN-2011','DD-MON-YYYY') order by sample_date

    20 JANUARY 2011.39
    20 JANUARY 2011.14
    20 JANUARY 2011.14
    20 JANUARY 2011.18
    21 JANUARY 2011.13


    Can someone explain what I am doing wrong? I tried a few different formats, without success.

    TIA

    Please update your handle something more staff.

    Watched your applications and found several problems. Make a copy of the Page 2 (Page 4); He is currently working.

    Problems found at Page 2:

    select null link, SAMPLE_DATE label, READING value1
    from  "METER_DATA"."METER_READINGS"
    

    had no Where clause; missing a statement Between; added or replaced Where clause to Page 4 for your original message

    select null link, SAMPLE_DATE label, READING value1
    FROM   meter_readings
    WHERE  sample_date BETWEEN To_date(:P4_START_DATE, 'DD-MON-YYYY') AND To_date(
                               :P4_END_DATE, 'DD-MON-YYYY')
    ORDER  BY sample_date;
    

    Button named; Date range Submit Redirected to Page 3 application; delete this button and adding a Submit button, who introduced the page and graphics rendering

    Maximum lines map series has been set at 50 lines; I fell the value up to 500 in order to get all the dates in your meter_readings table

    Jeff

  • error in date picker in collection report

    Hello
    I created the report using the code defined below .but I put a column in the select list and other column as date picker, when I select the value of the selection list and click on the button Add row, page is updated automatically by default. and when I choose the date date picker it gives error report invalid. but in the database, this cloumn is defined as the timestamp column. I'm trying to find the timestamp datepicker in apex_item but I don't have the code for this. Please tell me how I can do this.

    create the list of selection help
    APEX_ITEM. SELECT_LIST (1, 'Y',' Yes;) Y, no.; ONLY)

    and date as column
    APEX_ITEM. DATE_POPUP(4,rowNum,HireDate,'dd-mon-yyyy') hd, (I need the popup with date and time)



    I created the report using this code

    CREATE TABLE Bill
    (ID NUMBER NOT NULL,
    fruit VARCHAR2 (128).
    quantity NUMBER)
    /
    -The constraints for the BILL

    Bill ALTER TABLE
    ADD CONSTRAINT bill_pk PRIMARY KEY (id)
    /
    -Add sequences to generate a PK
    CREATE SEQUENCE bill_seq
    /
    -Triggers for BILL

    CREATE OR REPLACE TRIGGER bill_trg
    FRONT
    INSERT
    WE charge
    REFERRING AGAIN AS NINE OLD AND OLD
    FOR EACH LINE
    BEGIN
    SELECT BILL_SEQ. NEXTVAL INTO: DOUBLE NEW.ID;
    END;
    /

    I use a single page

    On this page, I created 2 regions
    1 html area with a single button with submmit "CREATE Bill."
    2. report with a report region, a button "Add line" and second botton "Save."

    Source of report:

    Select HTMLDB_ITEM. HIDDEN(1,SEQ_ID), HTMLDB_ITEM. C001 Text(2,a.C001), HTMLDB_ITEM. C002 Text(3,a.C002)
    OF wwv_flow_collections one
    where a.collection_name = 'COLL_BILL. '

    Condition
    Body of the PL/SQL function returning a Boolean
    Start
    If htmldb_collection.collection_exists ('COLL_BILL') then
    Returns true;
    on the other
    Returns false;
    end if;
    end;

    3 PLSQL process

    BEGIN
    htmldb_collection.create_or_truncate_collection
    (p_collection_name = > 'COLL_BILL');
    end;

    Condition
    When you press the button
    "CREATE A BILL."

    4 PLSQL process

    Start

    because me in 1... HTMLDB_APPLICATION. Loop G_F01. Count
    htmldb_collection. () UPDATE_MEMBER
    p_collection_name = > 'COLL_BILL ',.
    p_seq = > HTMLDB_APPLICATION. G_F01 (i),
    p_c001 = > HTMLDB_APPLICATION. G_F02 (i),
    p_c002 = > HTMLDB_APPLICATION. G_F03 (i)
    );

    end loop;

    htmldb_collection.add_member
    (p_collection_name = > 'COLL_BILL',)
    p_c001 = > null,
    p_c002 = > null
    );
    end;


    Condition
    When you press the button
    'Add the line '.

    5 PLSQL process

    Start
    because me in 1... HTMLDB_APPLICATION. Loop G_F01. Count

    Insert in the BILL (fruit, quantity)
    values
    (HTMLDB_APPLICATION. G_F02 (i), HTMLDB_APPLICATION. G_F03 (i));

    end loop;
    HTMLDB_COLLECTION. DELETE_COLLECTION ("COLL_BILL");
    end;

    Condition
    When you press the button
    "Save".



    Thank you
    Nisha

    Published by: Nisha Rani on September 9, 2009 04:00

    Nisha I worked; )

    Now I have the situation: no error, have date with time but I datapicker only in the last line. Generally well glance.

    What you need to do:

    1. try to rebuild your report query. My query is:

    Select APEX_ITEM. HIDDEN(1,SEQ_ID),

    DECODE (c001, NULL, APEX_ITEM. DATE_POPUP (2,rownum,a.c001,'DD/MM/YYYY HH24 ').
    APEX_ITEM. Text(2,TO_CHAR(TO_DATE(a.C001,'yy/mm/dd'),'dd/mm/yyyy'). » '|| C001 a.C003)),

    APEX_ITEM. C002 Text(3,a.C002).
    APEX_ITEM. C003 Hidden(4,a.C003) -here I PIN only times
    Of apex_collections one
    where a.collection_name = 'COLL_BILL. '

    2. rebuild your process to add a line

    Start

    because me in 1... HTMLDB_APPLICATION. Loop G_F01. Count

    apex_collection. () UPDATE_MEMBER
    p_collection_name-online "COLL_BILL."
    p_seq-online HTMLDB_APPLICATION. G_F01 (i),
    p_c001-online to_date (HTMLDB_APPLICATION. G_F02 (i), ' DD/MM/YYYY HH24'),
    p_c002-online HTMLDB_APPLICATION. G_F03 (i),
    p_c003-online to_char (to_date (HTMLDB_APPLICATION. G_F02 (i), ' DD/MM/YYYY HH24'), 'HH24') -collection time have thong
    );

    end loop;

    APEX_collection.add_member
    (p_collection_name-online 'COLL_BILL',
    p_c001-online null,
    p_c002-online null,
    p_c003-online null
    );

    end;

    Summary: I think that the collection keeps timestamp. When I debug the value in the collection I saw that data with the time still be converted "YY/MM/DD"..., I don't know why, but that's the reason for the problem

  • Date picker control element with submit?

    Hi people,

    on one of my pages, I use an element "Date Picker" and according to the date that I created a few other dynamic queries on the same page, which should be immediately recalculated (update) when the user selects a date. How can I invoke a SEND on this point (once the DATE is filled) without the manual page refresh?

    "With Submit date picker" would be the solution, but there is not this type of question.
    Or probably the javascript?

    Thank you
    Tomas

    Hello

    put this in the attributes of HTML form elements to the date element

    onchange="doSubmit()"
    

    See you soon

    Ben

  • My ipad is disabled. How to activate ipad without data loss? I know the password

    My ipad is disabled. How to activate ipad without data loss? I know the password

    You can not. If you know the password, how the iPad become disabled? If the device is disabled, the content is not already available. The only way to recover the device is to restore. You can restore your last backup after that. Follow the instructions in this document support. If you have forgotten the password for your iPad, iPhone or iPod touch, or your device is disabled - Apple supports

  • How Siri works with a hotspot wifi phone from ATT without data?

    How Siri works with a hotspot wifi phone from ATT without data? I have the hotspot & it recognizes my iPhone5c, but Siri cannot find a connection when I use it. My phone service is now but only phone at & t imessage. No data, unpaid for the text. It works fine on my home WiFi & works but not the hotspot.

    Siri requires an Internet connection

    It will not work without one

  • How to convert NTFS to FAT32 without data loss?

    Hello
    I want to format a computer with 4 logical partition, where C: is partitioned FAT (Windows NT Server), and other (D:, E: and F :) are on NTFS.

    Now I want to install Win98 on it, which requires the hard drive or FAT32 partitioned. How to do that without losing valuable data in all 3 NTFS partitioned drives.

    Hello

    I think you are very lucky.

    Aomei technology is giving away NTFS to FAT32 Converter Pro Edition 1.5 which can help you convert NTFS to FAT32 without data loss. The offer is limited from 18/05/2011 ~ 23/05/2011.
    Contest page: http://www.aomeitech.com/giveaway/ntfs2fat32.html

  • Using Palm Pre Plus on Verizon without data plan?

    Hello people,

    I'm trying to find out if it is possible to use a Palm Pre Plus on Verizon without data plan.

    Right now I have six years old phone clamshell and an iPod touch in my pocket, and I'm looking to consolidate. In addition, locked position of Apple don't gives me the warm shudder blur. WebOS from Palm running on the emulator gives me the warm fuzzies.

    Research on the issue with Google, I saw other people ask the question at the time was the Sprint Pre only. Apparently the Sprint did not yet allow activation of the phone without a data plan. In addition, the question of whether the palm profile account can be installed over wifi there.

    I also met photos showing that WebOS 1.2 would have a toggle to disable the use of the map data.

    So people, you guys what do you think? Is it possible that this is possible? Thank you!

    I suggest you look at www.precentral.net work is around like this. It is outside my area of support, but I'm sure you can find what you need there message board.

  • Converet GPT without data loss

    Hello

    I am formatting my system. Partition there are two in my drive C & E system. Now when I'm getting type format my PC. He is in error of TPG. I have given in the E drive, now if I use the command wipe the drive, it will clean my data. So, how can I change one partition or a full disk without data loss. We formatted our system C drive.

    Kind regards

    Kuldeep Singh

    Hello Kuldeep,

    Thanks for posting your question on the Microsoft community.

    We need more information about the issue so that we can help you better.

    What is the exact error message or code when you say, 'mislead the GPT?

    Thank you for details on the issue.

    GUID Partition table (TPG) is a new style of partitioning that is part of the Unified Extensible Firmware Interface (UEFI) specification. This is used for Windows 8 facilities factory for more flexibility of partition and

    more advanced features of Windows 8. With an installation of Windows 7, the GPT partition must be removed and UEFI BIOS must be configured in a configuration to boot Legacy.

    I suggest to check the following items and check if it helps.
    Reference:
    http://www.Dell.com/support/article/BB/en/bbdhs1/594701/en

    Windows and GPT FAQ
    https://msdn.Microsoft.com/en-us/library/Windows/hardware/dn640535 (v = vs. 85) .aspx

    Important notes:
    Converting a hard disk partition or volume from NTFS to FAT32 requires that you reformat the partition, which deletes all the data on this subject. Be sure to back up data that you want to keep before you begin.

    BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

    I hope this information helps.

    Please let us know if you need more help.

    Thank you

  • How to do an http Basic by wifi connection just without data plan?

    Ok. Here's the situation: I have developed an application that makes a connection http Basic (connector.open (url)). It woks fine on Simulator course since it uses the mds Simulator. I'm targeting os 5 and above. Now I started to test on the actual device (curve 9300). The real problem is how can I go out with just a default connection. I mean a generic that doesn't care what type of transport, the phone has and uses only the default. As you know has 9300 WiFi. So hopefully I should be able to connect using my wifi at home. On the phone, I can establish connection wifi fine. The phone's browser do not allow through well. He complains: (error! wifi detected...) We are not able to authenticate you as you are not currently a Rogers... Please turn off your wifi connection, and launch your browser to try again). Well, if it means that I'm not on Rogers, it is not correct, as my base phone package is with Rogers, the SIM set in the phone. I tried his suggestion and of course, it does not work!

    What encourages me that it should work in principle, but I have two phone applications (Opera mini and google map) who are able to go online and make the connection.

    I tried to use a combination of parameters attached to the url, as follows:

    1. just by default without any parameter

    2 - deviceside = true

    3 - deviceside = true; = wifi interface

    I also experimented with different options on options tcp apn:

    1 disabling APN setting

    2-activation parameter APN with internet.com, with comments from user and password

    setting of AFN 3 activation internet.com with wapuser1 and wap for the user name and password.

    To "manage connections", I have the following question similarly checked:

    -Network mobile Rogers...

    Dlink_RezaNetwork - Wi - Fi...

    -BlueTooth feature is disabled

    I wonder out exactly the Mobile network connection? I guess that's my basic phone plan puts online. I will be happy if that's the case for my app by there rather than the wifi connection if that is indeed what Opera mini and google map. But sorry to disappoint you, because even if I disable the first connection (i.e. Mobile network Rogers...) I am still able to use these two apps without problem! It makes me happy because it difinitely says I should be able to go online using only my wifi without data plan!

    On connection icons at the top of the phone to the right, I see the following

    Rogers - dlink.RezaNetwork 3 G (icon of the resistance)

    WiFi

    As you can see, my phone is connected to the wifi in my house.

    Anyway, after all this detail, anyone know if there is a solution to this problem? I mean google map and Opera Mini are able to go online without problem.

    In full respect, please don't refer me to read this or that doc I did those before you come and ask questions. But even if there is a doc that you think really go to address above concerns more precisely I'll gladly read

    I use eclipse for development and just well on Simulator.

    This is the result I get when I run the app through the eclipse on the device:

    (1) for the case when only a Wifi connection is enabled on the device connector.open (url) is called with no additional parameters, I get the error: net.rim.device.internal.io.criticalioexception: required radio isn't avtive.

    (2) for the case with wifi interface parameter defined as follows:

    String connStr = _theUrl + "; interface = wifi. "
    s = (connStr) Connector.open (StreamConnection);
    HttpConnection httpConn s = (HttpConnection);
    InputStream input = s.openInputStream ();

    There is no error reported, even though I capture all the exceptions of open(). But the stream returned is always empty!

    Thanks again.

    Just an update:

    The problem took over the redirect. It was a subject, I admit, I was quite familiar with. So, once read on responses from http status, the solution was easy. Also is it possible to simply use the wifi connection for http connections in the code. The build in the browser is another story and it depends on how the connection preferences are managed internally by the os and carrier I suppose, but lance in the code browser works very well, with just wifi traffic.

  • Date Picker help

    public static String Selectdate() { DateTimePicker datePicker = DateTimePicker.createInstance(); datePicker.doModal(); Calendar cal = datePicker.getDateTime(); Date date = cal.getTime(); return date.toString(); }
    

    I use the method above to choose the date, but it also shows me the time that I need to see the time I just wants to select only the date. Can someone help me please...

    The API tells you how to do that is it not?

    public static DateTimePicker createInstance (calendar, calendar,
    String datePattern,
    String timePattern)

    Returns a date with an initial display date picker and the format of the date and time. If datePattern and timePattern are null, then will serve as the default time and date formats.
    Parameters:
    calendar - original date to display
    datePattern - the SimpleDateFormat to date. If datePattern is null and timePattern is not null, then a date will not be shown. The model should include only text templates (for example ' / ',': ') and date of models for example DateFormat.YEAR_FIELD, DateFormat.MONTH_FIELD, DateFormat.DATE_FIELD, DateFormat.DAY_OF_WEEK_FIELD. Other symbols of format will be ignored.
    timePattern - the SimpleDateFormat for now. Passing null will not display a time if timePattern is null and datePattern is not null, then an hour does not appear.

  • PROBLEM WITH DATE PICKER:

    Hi, I want to use the date picker as it... and set to the current value of default.and use another text box to display the selected value... to datepicker.can someone give me the entire code? If I want to write the value selected, run time using a picture as a textbox, what should I do?... Please help me... its urgent...

    OK, but I used the images for what little arrows... to prevmonth, nextmonth, prevyear and next.

    Here's the code...

    import net.rim.device.api.ui.container.PopupScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.Graphics;
    import net.rim.device.api.ui.Color;
    import net.rim.device.api.ui.Font;
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.system.Display;
    import net.rim.device.api.ui.FieldChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.DrawStyle;
    import net.rim.device.api.system.Characters;
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.util.DateTimeUtilities;
    import net.rim.device.api.i18n.SimpleDateFormat;
    import java.util.Calendar;
    import java.util.Date;
    
    import com.LMS.CustomManagers.TableLayoutManager;
    /**
     *
     */
    public class CalendarPopup extends PopupScreen implements FieldChangeListener {
    
        private boolean isClosed = false;
        private static SimpleDateFormat sdfWeekDay = new SimpleDateFormat("Ei");
        private static SimpleDateFormat sdfMonth = new SimpleDateFormat("MMM yyyy");
        private Calendar _cl = Calendar.getInstance();
    
        private Bitmap PrevYearFocus = Bitmap.getBitmapResource("cal_previous_year.png");
        private Bitmap PrevMonthFocus = Bitmap.getBitmapResource("cal_previous_month.png");
        private Bitmap NextMonthFocus = Bitmap.getBitmapResource("cal_next_month.png");
        private Bitmap NextYearFocus = Bitmap.getBitmapResource("cal_next_year.png");
        private Bitmap PrevYear = Bitmap.getBitmapResource("cal_previous_year_focus.png");
        private Bitmap PrevMonth = Bitmap.getBitmapResource("cal_previous_month_focus.png");
        private Bitmap NextMonth = Bitmap.getBitmapResource("cal_next_month_focus.png");
        private Bitmap NextYear = Bitmap.getBitmapResource("cal_next_year_focus.png");
    
        private static int [] tableStyles = new int [] {
            TableLayoutManager.FIXED_WIDTH,
            TableLayoutManager.FIXED_WIDTH,
            TableLayoutManager.FIXED_WIDTH,
            TableLayoutManager.FIXED_WIDTH,
            TableLayoutManager.FIXED_WIDTH,
            TableLayoutManager.FIXED_WIDTH,
            TableLayoutManager.FIXED_WIDTH
        };
        private int [] tableSizes = new int [7];
        private TableLayoutManager _monthManager; // This is where we display the Dates
    
        private static String FIELD_SIZE_STRING = " 30 ";
        private static String SINGLE_BLANK = " ";
    
        private int _currentFocusDay;
        private int _currentMonth; // This is the month as usually defined. // In Calendar, January is month 0.
        private int _currentYear;
        private String _currentMonthString = "MMM yyyy";
        private Field _initialFocusField = null;
        private int _selectedDay = -1; // None selected
    
        private Font _normalFont;
        private Font _boldFont;
    
        private ClickbleImage PrevYearBut, PrevMonthBut, NextMonthBut, NextYearBut;
        private BorderedLabel MonthDisplay,Today;
    
        public CalendarPopup(Date selectedDate) {
            super(new VerticalFieldManager(){
                    public void sublayout(int width, int height) {
                        super.sublayout(Display.getWidth(),height);
                    }
                });
            _cl.setTime(selectedDate);
            createScreen(_cl.get(Calendar.DAY_OF_MONTH), _cl.get(Calendar.MONTH) + 1, _cl.get(Calendar.YEAR));
        }
    
        public boolean isClosed(){
            return isClosed;
        }
        private void displayMonth() {
            _monthManager.deleteAll(); // Delete the stuff currently there
    
            // Determine start of the Month
            _cl.set(Calendar.DAY_OF_MONTH, 1);
            _cl.set(Calendar.MONTH, _currentMonth - 1);
            _cl.set(Calendar.YEAR, _currentYear);
            _cl.set(Calendar.HOUR_OF_DAY, 12);
            _cl.set(Calendar.MINUTE, 0);
            _cl.set(Calendar.SECOND, 0);
            _cl.set(Calendar.MILLISECOND, 1);
            long startOfMonth = _cl.getTime().getTime();  
    
            // set Month in 'header'
            _currentMonthString = sdfMonth.formatLocal(_cl.getTime().getTime());
    
            // Figure out where the month display needs to start
            int workDay = _cl.get(Calendar.DAY_OF_WEEK);
            int startAt = 0;
            switch (workDay) {
                case(Calendar.MONDAY): {
                    startAt = 0;
                    break;
                }
                case(Calendar.TUESDAY): {
                    startAt = -1;
                    break;
                }
                case(Calendar.WEDNESDAY): {
                    startAt = -2;
                    break;
                }
                case(Calendar.THURSDAY): {
                    startAt = -3;
                    break;
                }
                case(Calendar.FRIDAY): {
                    startAt = -4;
                    break;
                }
                case(Calendar.SATURDAY): {
                    startAt = -5;
                    break;
                }
                case(Calendar.SUNDAY): {
                    startAt = -6;
                    break;
                }
            }
            Date workDate = _cl.getTime();
            long workDateTime = workDate.getTime() + ((long)startAt) * ((long)DateTimeUtilities.ONEDAY);
    
            //long dayTime = workDateTime;
            for ( int i = 0; i < 42; i++ ) { // Need at most 6 rows
                workDate.setTime(workDateTime);
                _cl.setTime(workDate);
                workDateTime = workDateTime + DateTimeUtilities.ONEDAY;
                BorderedLabel blf = null;
                //int actualDate = _cl.get(Calendar.DAY_OF_MONTH);
                int actualDate = _cl.get(Calendar.DAY_OF_MONTH);
                String tempDateString = Integer.toString(actualDate);
                int textColor = Color.BLACK;
                if ( _cl.get(Calendar.MONTH) == _currentMonth - 1 ) {
                    if ( _currentFocusDay == actualDate ) {
                        _initialFocusField = blf;
                        textColor = Color.RED;
                    }
                    blf = new BorderedLabel(tempDateString, LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER | LabelField.FOCUSABLE,textColor);
                } else
                if ( (i % 7 == 0) && (startOfMonth < _cl.getTime().getTime()) ) {
                    // We have finished the month
                    break;
                } else {
                    blf = new BorderedLabel(tempDateString, LabelField.USE_ALL_WIDTH | DrawStyle.HCENTER,Color.LIGHTGREY);
                }
                blf.setChangeListener(this);
                _monthManager.add(blf);
            }
            if ( this.isDisplayed() && _initialFocusField != null ) {
                _initialFocusField.setFocus();
                _initialFocusField = null;
            }
            MonthDisplay.SetText(_currentMonthString);
        }
    
        private void createScreen(int focusDay, int startMonth, int startYear) {
            // Initial values for Screen
            _currentFocusDay = focusDay;
            _currentMonth = startMonth;
            _currentYear = startYear;
            final VerticalFieldManager topManager = new VerticalFieldManager(FIELD_HCENTER){
                    public void paint(Graphics g){
                        g.setColor(0x333333);
                        g.fillRect(0,0,getWidth(),getHeight());
                        super.paint(g);
                    }
                };
    
            int columnSize = this.getFont().getAdvance(FIELD_SIZE_STRING);
            for ( int i = 0; i < tableSizes.length; i++ ) {
                tableSizes[i] = columnSize;
            }
            _monthManager = new TableLayoutManager(tableStyles, tableSizes, 0, TableLayoutManager.FIELD_HCENTER){
                    public void paint(Graphics g){
                        g.setColor(Color.WHITE);
                        g.fillRect(0,0,getWidth(),getHeight());
                        super.paint(g);
                    }
                };
    
            VerticalFieldManager bottomManager = new VerticalFieldManager(FIELD_HCENTER){
                    public void paint(Graphics g){
                        g.setColor(0x333333);
                        g.fillRect(0,0,getWidth(),getHeight());
                        super.paint(g);
                    }
                    protected void sublayout(int width, int height) {
                        super.sublayout(width, height);
                        setExtent(topManager.getWidth(), 30);
                    }
                };
            PrevYearBut = new ClickbleImage(PrevYearFocus,PrevYear,FIELD_HCENTER | FOCUSABLE);
            PrevYearBut.setChangeListener(this);
            PrevMonthBut = new ClickbleImage(PrevMonthFocus,PrevMonth,FIELD_HCENTER | FOCUSABLE);
            PrevMonthBut.setChangeListener(this);
            MonthDisplay = new BorderedLabel(_currentMonthString,NON_FOCUSABLE,Color.WHITE);
            MonthDisplay.setChangeListener(this);
            NextMonthBut = new ClickbleImage(NextMonthFocus,NextMonth,FIELD_HCENTER | FOCUSABLE);
            NextMonthBut.setChangeListener(this);
            NextYearBut = new ClickbleImage(NextYearFocus,NextYear,FIELD_HCENTER | FOCUSABLE);
            NextYearBut.setChangeListener(this);
            HorizontalFieldManager hfm  = new HorizontalFieldManager(FIELD_HCENTER);
            hfm.add(PrevYearBut);hfm.add(new VerticalSpacer(5,3));
            hfm.add(PrevMonthBut);hfm.add(new VerticalSpacer(5,3));
            hfm.add(MonthDisplay);hfm.add(new VerticalSpacer(5,3));
            hfm.add(NextMonthBut);hfm.add(new VerticalSpacer(5,3));
            hfm.add(NextYearBut);
            topManager.add(hfm);
    
            TableLayoutManager _daysManager = new TableLayoutManager(tableStyles, tableSizes, 0,TableLayoutManager.FIELD_HCENTER);
            String [] days = {"Mo","Tu","We","Th","Fr","Sa","Su"};
            for(int i = 0 ; i < days.length;i++){
                _daysManager.add(new BorderedLabel(days[i],NON_FOCUSABLE | FIELD_HCENTER,Color.WHITE));
            }
            topManager.add(_daysManager);
            displayMonth();
    
            HorizontalFieldManager hfm1  = new HorizontalFieldManager();
            Today = new BorderedLabel("Today",FOCUSABLE | FIELD_VCENTER,Color.WHITE);
            Today.setChangeListener(this);
            int space = Display.getWidth() >= 480 ? 130 : 90;
            hfm1.add(new VerticalSpacer(30,space));hfm1.add(Today);hfm1.add(new VerticalSpacer(30,space));
            bottomManager.add(hfm1);
    
            this.add(topManager);
            this.add(_monthManager);
            this.add(bottomManager);
        }
        protected void onDisplay() {
            if ( _initialFocusField != null ) {
                _initialFocusField.setFocus();
                _initialFocusField = null;
            }
            super.onDisplay();
        }
        public void fieldChanged(Field field, int context){
            _currentFocusDay = -1; // Leave focus on 'button'
            _initialFocusField = field;
            int monthIncrement = 33;
            if(field instanceof ClickbleImage){
                if(field == PrevYearBut){
                    _currentYear = _cl.get(Calendar.YEAR)-1;
                    displayMonth();
                }else if(field == PrevMonthBut){
                    monthIncrement = -3;
                    processMonth(monthIncrement);
                }else if(field == NextMonthBut){
                    processMonth(monthIncrement);
                }else if(field == NextYearBut){
                    _currentYear = _cl.get(Calendar.YEAR)+1;
                    displayMonth();
                }
            }else if(field instanceof BorderedLabel){
                if(field == MonthDisplay){
                }else if(field == Today){
                    _cl.setTime(new Date());
                    _currentFocusDay = _cl.get(Calendar.DAY_OF_MONTH);
                    _currentMonth = _cl.get(Calendar.MONTH) + 1;
                    _currentYear = _cl.get(Calendar.YEAR);
                    displayMonth();
                }else {
                    LabelField lab = (LabelField) field;
                    _selectedDay = Integer.parseInt(lab.getText());
                    close();
                }
            }
        }
        private void processMonth(int monthIncrement){
            _cl.set(Calendar.DAY_OF_MONTH, 1);
            _cl.set(Calendar.MONTH, _currentMonth-1);
            _cl.set(Calendar.YEAR, _currentYear);
            Date workDate = _cl.getTime();
            workDate.setTime(workDate.getTime() + (((long)monthIncrement) * ((long)DateTimeUtilities.ONEDAY)));
            _cl.setTime(workDate);
            _currentMonth = _cl.get(Calendar.MONTH) + 1;
            _currentYear = _cl.get(Calendar.YEAR);
            displayMonth();
        }
        public void close() {
            UiApplication.getUiApplication().popScreen(this);
        }
        public Date getSelectedDate() {
            if ( _selectedDay == -1 ) {
                return null;
            }
            Calendar cl = Calendar.getInstance();
            cl.set(Calendar.YEAR, _currentYear);
            cl.set(Calendar.MONTH, _currentMonth - 1);
            cl.set(Calendar.DAY_OF_MONTH, _selectedDay);
            cl.set(Calendar.HOUR_OF_DAY, 0);
            cl.set(Calendar.MINUTE, 0);
            cl.set(Calendar.SECOND, 0);
            cl.set(Calendar.MILLISECOND, 1);
            return cl.getTime();
        }
        public boolean keyChar(char key, int status, int time) {
            boolean retval = false;
            switch (key) {
                case Characters.ENTER: {
                    // We have selected something
                    break;
                }
                case Characters.ESCAPE: {
                    close();
                    isClosed = true;
                    retval = true;
                    break;
                }
                default:
                    break;
           }
           return retval;
        }
    } 
    
    class ClickbleImage extends Field {
        private Bitmap bitmap1,bitmap2,img;
        private boolean isFocus = false;
        public ClickbleImage(Bitmap bitmap1,Bitmap bitmap2,long style) {
            super(style);
            this.bitmap1 = bitmap1;
            this.bitmap2 = bitmap2;
            img = bitmap1;
        }
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(0);
            return true;
        }
        protected void onUnfocus() {
            isFocus = false;
            super.onUnfocus();
            img =  bitmap1;
            invalidate();
        }
        protected void onFocus(int direction) {
            super.onFocus(direction);
            isFocus = true;
            img =  bitmap2;
            invalidate();
        }
        public void paint(Graphics g){
            g.drawBitmap((this.getWidth()-img.getWidth())/2,(this.getHeight()-img.getHeight())/2,img.getWidth(),img.getHeight(),img,0,0);
        }
        protected void layout(int w, int h){
            setExtent(20,20);
        }
        protected void drawFocus(Graphics graphics, boolean on) {
        }
    } 
    
    class BorderedLabel extends LabelField {
        int width,height,color;
        private String text;
        private Font font;
        public BorderedLabel(String text, long style,int TextColor) {
            super(text, style);
            SetFont(Font.PLAIN,18);
            this.color = TextColor;
            this.text = text;
        }
        public void SetText(String text){
            this.text = text;
            invalidate();
        }
        public void paint(Graphics g) {
            width = this.getWidth();
            height = this.getHeight();
            if(isFocus()){
                g.setColor(Color.YELLOW);
                g.fillRect(0,0,width,height);
                g.setColor(Color.BLACK);
            }else {
                g.setColor(color);
            }
            g.drawText(text, (getWidth() - font.getAdvance(text))/2, (getHeight() - font.getHeight())/2);
        } 
    
        protected void onFocus(int direction) {
            super.onFocus(direction);
            invalidate();
        } 
    
        protected void onUnfocus() {
            super.onUnfocus();
            invalidate();
        } 
    
        private void SetFont(int font_style, int font_size) {
            font = Font.getDefault().derive(font_style,font_size);
            this.setFont(font);
        }
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(0);
            return true;
        }
    }
    
    class VerticalSpacer extends Field {
        // Only for VerticalFieldManagers
        private int _height;
        private int _width;
        public VerticalSpacer(int height, int width) {
            super(Field.NON_FOCUSABLE);
            _height = height;
            _width = width;
        }
        public void layout(int width, int hieght) {
            setExtent(_width, _height);
        }
        public void paint(Graphics g) {
        }
    }
    

    I think you have the right to TableLayoutManager? If this isn't the case, then search the forum and you will get. Which I used here.

    call this class-

    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

    You can use any format here (above)

    CalendarPopup dd = new CalendarPopup (date)

    UiApplication.getUiApplication () .pushModalScreen (dd);
    {if (!) CDI IsClosed())}
    Date selectedDate = dd.getSelectedDate ();
    String DateStrValue = formatter.format (selectedDate) m:System.NET.SocketAddress.ToString ();
    textbox.setText ((DateStrValue) formatter.format m:System.NET.SocketAddress.ToString ());
    }

    TextBox is the lable field or anything like that

  • BlackBerry Smartphones Verizon without data?

    I have a Curve 8310 and a Bold 9650.  I use very little ot my package data and would like to block data through Verizon and just pay for phone service.  I like both phones, but can't justify the additional cost.  I blocked data on phones of my children (two PARENTS and a phone data LG loan).  Verizon told me that they "can't" block data for these phones.  Is this true?  Why?  These phones are unusable without data?  I can't get updates to the computer?  Please enlighten me.  Thank you

    Hello and welcome to the community!

    BBs without data plans are, IMHO, near useless, and not useful to have. There are just too many services that they depend on a data plan that is appropriate for the feature. But, having said that, there is nothing on the BB himself who said: he cannot work as just a phone without a data plan. However, each company has its own policies and procedures... it is quite possible that VZW will not allow a BB on their network without a correct data... plan and being their network, they have every right to have such a policy.

    Good luck!

Maybe you are looking for

  • TPC-2106 t related query

    I want to connect TPC-2106 t with the CompactRIO-9014 cable RS-232 (serial). Could I connect to end of data i.e. communication to send orders in real time PTC VI, who will present the CompactRIO and receive data from the PTC something generating VI r

  • Windows Update does not work on new installations of XP Pro

    Hello world I installed a new copy of Windows XP Professional on a Dell Precision, I am about to sell, but for some reason any Windows Update does not work. I reinstalled Windows many times, but I still get the same error in WindowsUpdate.log: Detect

  • What type of license?

    What type of license my boss can buy if it wants to have a windows server 2008 as a domain controller a file server for 16 windows xp clients? Thank you. Julio.

  • Upgrade Windows 8 / / Touchpad doesn't work is not right - Acer Aspire V5 - 531

    Hello Ive upgraded to Win 7 Home Premium to Win 8 Pro using the Acer Windows 8 Upgrade Tool everything was completed with success not at all last night but today Ive turned on the laptop and my touchpad does not work well and the cursor acts as if so

  • Suspected virus / malware

    My first post was yesterday and I have quoted me this Council instead.  We had received warnings of Vista Anitvirus 2008 indicating virus has been detected.  We have Trend Micro PC-cillin on our compueter, not Vista.  We scanned and he did not return