F:convertDateTime - how to define two valid date formats?

I have an input field that accepts a date. There are two valid date formats allowed: yyyyMMdd & yyyyMMM
I am currently doing this ...
<h:inputText ...>
<f:convertDateTime pattern="yyyyMMdd" />
<f:convertDateTime pattern="yyyyMMM" />
</h:inputText>
... but only the second date format is being accepted as valid.
How can I specify two valid date formats for the input?
Thanks,
rh
Edited by: user13328234 on Oct 27, 2010 12:47 PM

user13328234 wrote:
Thanks for the suggestion. I was actually using it for validation, so I implemented a custom validator so I'm good now.
But, for some reason I expected it to work with two converters specified, and I'm a little disappointed it didn't work.
Thanks again,
rhExpecting = assuming. Its getting old and annoying now, but it remains a very bad idea.
The fact of the matter is that you have a very specific need. There is only one way to tailor to specific needs in a generic API: allow to override default behavior. The other option is to create a bloated API that tries to incorporate so many bells and whistles that it becomes unusable. So in my opinion, JSF is designed exactly the way it is supposed to be in this respect.

Similar Messages

  • How to comapare two tables data difference

    Hi all,
    Can any one tell me how to compare two tables data of two different data bases .
    Table names are same in both databases.
    Thanks You
    Regards,
    P Prakash

    833560 wrote:
    I don't have privilege to create data base link ,If the database has no link so that you can query the the data, you have two options.
    Find someone with the privilege to create the link and write a query like this
    Re: Efficient way to comapre two tables.
    Which as I mention may not be quick,
    Kindly tell me some other way .But will be quicker than your other option which is to dump the data into two spreadsheets and start reading.

  • How to get Default (System) Date Format Pattern?

    How to get system default date format which is defined in Regional Setting of Control Panel.
    We can get an instance of DateFromat using DateFormat.getDateInstance(DateFormat.SHORT) but problem is that there is no toPattern() exist in class DateFormat.
    However toPattern() exist in class SimpleDateFormat but there is no costructor like SimpleDateFormat(DateFormat)
    So please advise me, how can I get system short date format pattern?
    Thanks
    GAJESH TRIPATHI

    I reterieve the system date format but not which is currently defined in regional setting of control panel but it returns the format which is installed by default when windows(os) is installed.
    Edited by: gajesh on ? ????????, ???? ??:?? ?????????
    Thanks to provide me solution. My source code related problem is solved but still I am not getting format which is defined in control panel. but By Letting that it is not possible in Java,... I am doing my next work...so CLOSE THIS TOPIC Thanks'n Bye.

  • How can we give the Data Format (File Type ) in Runtime

    Hi all,
    How can we give the Data Format (File Type ) in Runtime for the following method,
    cl_gui_frontend_services=>gui_download.
    Thanks in advance
    Sri

    There is a filetype parameter which you can set
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
    *    BIN_FILESIZE              =
        filename                  =
    *    FILETYPE                  = 'ASC'
    *    APPEND                    = SPACE
    *    WRITE_FIELD_SEPARATOR     = SPACE
    *    HEADER                    = '00'
    *    TRUNC_TRAILING_BLANKS     = SPACE
    *    WRITE_LF                  = 'X'
    *    COL_SELECT                = SPACE
    *    COL_SELECT_MASK           = SPACE
    *    DAT_MODE                  = SPACE
    *    CONFIRM_OVERWRITE         = SPACE
    *    NO_AUTH_CHECK             = SPACE
    *    CODEPAGE                  = SPACE
    *    IGNORE_CERR               = ABAP_TRUE
    *    REPLACEMENT               = '#'
    *    WRITE_BOM                 = SPACE
    *    TRUNC_TRAILING_BLANKS_EOL = 'X'
    *  IMPORTING
    *    FILELENGTH                =
      changing
        data_tab                  =
    *  EXCEPTIONS
    *    FILE_WRITE_ERROR          = 1
    *    NO_BATCH                  = 2
    *    GUI_REFUSE_FILETRANSFER   = 3
    *    INVALID_TYPE              = 4
    *    NO_AUTHORITY              = 5
    *    UNKNOWN_ERROR             = 6
    *    HEADER_NOT_ALLOWED        = 7
    *    SEPARATOR_NOT_ALLOWED     = 8
    *    FILESIZE_NOT_ALLOWED      = 9
    *    HEADER_TOO_LONG           = 10
    *    DP_ERROR_CREATE           = 11
    *    DP_ERROR_SEND             = 12
    *    DP_ERROR_WRITE            = 13
    *    UNKNOWN_DP_ERROR          = 14
    *    ACCESS_DENIED             = 15
    *    DP_OUT_OF_MEMORY          = 16
    *    DISK_FULL                 = 17
    *    DP_TIMEOUT                = 18
    *    FILE_NOT_FOUND            = 19
    *    DATAPROVIDER_EXCEPTION    = 20
    *    CONTROL_FLUSH_ERROR       = 21
    *    NOT_SUPPORTED_BY_GUI      = 22
    *    ERROR_NO_GUI              = 23
    *    others                    = 24

  • How can I change the date format in Reminders and in Notes?

    How can I change the date format in both Notes and Reminders? Preference on Imac and Settings in IOS do not allow me to change the format in those 2 apps.
    I Like to see 10oct rather than 10/10, as an example.

    pierre
    I do not have Mavericks or iOS - but the first thing I would do is reset the defaults - I'll use Mavericks as an example
    From If the wrong date or time is displayed in some apps on your Mac - Apple Support
    OS X Yosemite and Mavericks
        Open System Preferences.
        From the View menu, choose Language & Region.
        Click the Advanced button.
        Click the Dates tab.
        Click the Restore Defaults button.
        Click the Times tab.
        Click the Restore Defaults button.
        Click OK.
        Quit the app where you were seeing incorrect dates or times displayed.
        Open the app again, and verify that the dates and times are now displayed correctly.
    Then customize to taste - OS X Mavericks: Customize formats to display dates, times, and more
    OS X Mavericks: Customize formats to display dates, times, and more
    Change the language and formats used to display dates, times, numbers, and currencies in Finder windows, Mail, and other apps. For example, if the region for your Mac is set to United States, but the format language is set to French, then dates in Finder windows and email messages appear in French.
        Choose Apple menu > System Preferences, then click Language & Region.
        Choose a geographic region from the Region pop-up menu, to use the region’s date, time, number, and currency formats.
        To customize the formats or change the language used to display them, click Advanced, then set options.
        In the General pane, you can choose the language to use for showing dates, times, and numbers, and set formats for numbers, currency, and measurements.
        In the Dates and Times panes, you can type in the Short, Medium, Long, and Full fields, and rearrange or delete elements. You can also drag new elements, such as Quarter or Milliseconds, into the fields.
        When you’re done customizing formats, click OK.
        The region name in Language & Region preferences now includes “Custom” to indicate you customized formats.
    To undo all of your changes for a region, choose the region again from the Region pop-up menu. To undo your changes only to advanced options, click Advanced, click the pane where you want to undo your changes, then click Restore Defaults.
    To change how time is shown in the menu bar, select the “Time format” checkbox in Language & Region preferences, or select the option in Date & Time preferences.
    Here's the result AppleScript i use to grab the " 'Short Date' ' + ' 'Short Time' "  to paste into download filenames - works good until I try to post it here - the colon " : " is a no-no but is fine in the Finder
    Looks like iOS Settings are a bit less robust
    - Date/Time formats are displayed according to 'tradition' of your region > http://help.apple.com/ipad/8/#/iPad245ed123
    buenos tardes
    ÇÇÇ

  • How to update the default date format in OBIEE 11G.

    Hi All,
    How to change the default date format in OBIEE 11g from the MM/DD to DD/MM. Could anyone please help me out ASAP?
    Thanks,
    Arpan

    Hi Arpan
    OBIEE 11g is having " localedefinitions.xml " file at this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display
    in my case i installed at C:\Oracle\MIddleware.
    so
    1- Stop BI Server from EM
    2- Navigate to this Location C:\Oracle\Middleware\Oracle_BI1\bifoundation\web\display. in your case oracle home will be different
    3- take a backup of this file localedefinitions.xml "
    4- modify it and save
    5- bring BI Server up.
    Regards
    sher

  • Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?

    Formscentral - how do I change required date format to long date (e.g. January 2, 2014) in a form field?  I can't seem to change it from the short date format.

    Hi,
    I would suggest you to change the form language to English (UK), Here are the steps:-
    1. Open your form in FormsCentral
    2. Clik on Options tab
    3. Click on Language and Formatting and check out the selection for Form Language and make sure English (U.K.) is selected and the default date format should be day/month/year.
    Regards,
    Nakul

  • How to convert milliseconds to date format in sql query

    Hi All,
    The following code is in java.     
    String yourmilliseconds = "1316673707162";**
    Date resultdate = new Date(Long.parseLong(yourmilliseconds));
    could you plese tell me how to convert milliseconds into date format in query and comparing with another date like(sysdate-3)

    Hello,
    http://stackoverflow.com/questions/3820179/convert-epoch-to-date-in-sqlplus-oracle
    Regards

  • How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    How can i change the date format mm/dd/yyyy to dd/mm/yyyy

    Date, time and currency formats are controlled via Settings > General > International > Region Format - you can't just change the date format

  • How does one change the date format for PlayMemories Home folders?

    I am using PlayMemories Home Version 2.0.00.11271 and have many folders within it which contain only photographs imported from my Sony DSC-H9.  Unfortunately, PlayMemories Home insists upon dating all folders in a month/day/year manner; and this makes little sense if one wishes to have the folders listed in logical chronological order.  How can I change the date format to year/month/day?  Changing the name of each folder, one by one, will take a very long time!  Your helpful advice in this matter will be greatly appreciated.  Thank you. System information:
    Operating system: Microsoft Windows XP Professional
    Service pack : Service Pack 3
    Memory: 1.5 GB
    Processor:         Intel(R) Pentium(R) M processor 1.86GHz
    Max. clock speed: 1.86
    Manufacturer: IBM
    Model: 1847W76
    System language setting: English (United States)
    User language setting: English (United States) 

    I too thought that the folder naming format was obviously wrong and couldn't find a way to change it. I do agree that placing photos in folders according to when they were taken is a great idea. I had been considering writing some software to do just that. After discovering that PlayMemories does it, I had it re-import all my photos. Then I wrote a small Perl script to rename all of the folders into year-month-day format. Included here is the Perl script. It only acts on a single folder - use it on the root folder where all the PlayMemories folders are. It will rename all folders currently in a month-day-year format. I used it without problems but of course there is no guarentee that it is error free. This should work with any common version of Perl. Tom # There should be one command line argument: the directory to act upon
    if ( scalar(@ARGV) == 0 ){
     print "Usage: RenameDirs <dir>\n";
     print " Where dir is the directory containing the directories to rename.\n";
     exit;
    $mydir = $ARGV[0];
    chdir $mydir or die "Couldn't chdir to $mydir: $!";
    opendir(ROOTPHOTODIR, ".") or die "Failed to open the pictures directory $mydir: $!";
    @allphotodirs = readdir ROOTPHOTODIR;
    closedir ROOTPHOTODIR;
    foreach $dir (@allphotodirs) {
     if ( -d $dir ) {
      print "$dir is a directory";
      if ( $dir =~ /^(\d{1,2})-(\d{1,2})-(\d{4})$/ ) {
       print " and has the proper format: month $1 day $2 year $3 and will be renamed to ";
       $newname = sprintf "%4u-%02u-%02u", $3, $1, $2;
       print "$newname\n";
       rename $dir, $newname or die "failed to rename $dir to $newname: $!";
      else {
       print " but is not of the proper format\n"
     elsif ( -f $dir ) {
      print "$dir is a file\n";
     else {
      print "$dir is neither a directory nor a file\n";
    }

  • Xml Form Builder Project - How to define the due date of a news?

    Hi,
    in a Xml Form Builder Project how can I define the due date of a news?
    If I define the start date and the end date how can I define the rules?
    tnx

    Hi Ennius,
    The timestamp control enables the input of the date and time. You can use this control to create u2018valid fromu2019 and u2018valid untilu2019 fields in order to restrict the lifetime of objects for time-based publishing.
    You can refer to this help links for more details .
    http://help.sap.com/saphelp_ep60sp2patch5/helpdata/en/b4/fd2c407586ea01e10000000a155106/frameset.htm
    http://help.sap.com/saphelp_ep60sp2patch5/helpdata/en/b4/fd2c407586ea01e10000000a155106/frameset.htm
    Also let us know your requirement more clearly so that i can try helping you .
    Thanks ,
    Swetha

  • How can I parse this date format?

    Hey,
    i am trying to write an interface between two applications. One application gives me the following date:
         Wed Jul 16 12:18:20 CEST 2003
    but I need it to look like this:
         16.07.03 12.18:20
    I tryed to use Date and DateFormat to parse and change it but the Date was unparseable.
    I hope somebody can point me to the right direction or show me how I can do the formating.
    Thanx a lot!
    Martin

    If this isn't a well-known date format, I can't see any solution but to write small function yourself which doe the job.
    you can start with :
    String source = "Wed Jul 16 12:18:20 CEST 2003";
    String[] elements = source.split();//splits source around spaces
    then you write functions that map day of week with numbers
    "Mon" --> 1
    "Tue" --> 2
    etc...
    it won't take you days to write this.
    Sometimes it's faster to write the stuff yourself than spending days looking for something pre-defined that may or may not exist.

  • How can I change the date format in a Numbers table?

    I have selected all of the cells in a date column, opened the Inspector and selected the Date & Time format, selected the date & month format butb the cell date does not conform to this format.  Instead I am getting the month, day, year, and time.
    Stu

    Stu,
    In order for Numbers to format the date it must already be a valid date.  If you post a screenshot we can see that the dat is valid.
    Make sure after you enter the date that the date ends up being right justified AUTOMATICALLY.  If the date is NOT valid, Numbers interprets it simply as text which it leaves left justified

  • How to get a correct date format

    Hi Experts,
    I fetched a record from the table KALV. Here its showing the date format as DD.MM.YYYY. But in my internal table and my output its showing YYYYMMDD.
    How to solve this?
    Actually this report needs to show the output as per the user's format. Because may have different format. Accoriding to there format it should show the output.
    How todo this?
    Anyone guide this?
    Mohana
    Moderator Message: Basic Question.
    Edited by: kishan P on Feb 3, 2011 4:14 PM

    Here's a sample of the code:
    [NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehavior10_4];
    NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
    [dateFormatter setDateStyle:NSDateFormatterShortStyle];
    NSDate *date = [ dateFormatter dateFromString:@"7/4/2008" ];
    NSLog(@"string from date %@: %@ for locale %@", date, [dateFormatter stringFromDate:date], [[dateFormatter locale] localeIdentifier]);
    (the same code without the messed up forum syntax is at http://pastebin.com/f695ef95b)
    When I set my region (in the International system preferences) to be United States, it prints:
    2008-08-14 20:20:31.117 Date Difference[17226:10b] string from date 2008-07-04 00:00:00 -0400: 7/4/08 for locale en_US
    And when my region is United Kingdom, it prints:
    2008-08-14 20:19:23.441 Date Difference[17199:10b] string from date 2008-04-07 00:00:00 -0400: 07/04/2008 for locale en_GB
    It looks like the NSDateFormatter is insensitive to the change of regions. Notice that the raw printing of the date is properly switching with the region, though.
    What do I have to do to get the NSDateFormatter to respect the region setting?

  • How do I change the date format?

    Sorry, but I'm new to Oracle!
    I'm using "sqlplusw" to build my SQL statements. When I return columns that are date fields, I get the DD-MON-YY format. I want dates to be returned in "YYYY-MM-DD HH24:MI:SS". My DBA won't change the date format on the server, so how do I change SQLPLUS to return dates in the format I want? Do I need set this in some kind of startup file, or a reg key?
    Using client version 9.2.0.5 against a 9.2.0.1 server
    Jeff

    There are a couple of ways you could do it.
    Way 1:
    Search for a file by name 'glogin.sql' on your client work station and add the following statement
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure you save the file. This change will apply to all users who will log into the database using SQL*PLUS from your machine.
    Way 2:
    Create a shortcut and place it some where (for example on the 'DESKTOP').
    Right click on the short cut and choose properties.
    Change the text corresponding to the 'Start in' box to reflect the current location of the shortcut.
    Create a file by name 'login.sql' and place it in the same folder as the shortcut.
    Edit the file and add the following line.
    alter session set nls_date_format = 'YYYY-MM-DD HH24:MI:SS';Make sure that you save the file.
    When you double click the shortcut to start SQL*Plus and login, the script 'login.sql' is executed.

Maybe you are looking for