Date Format Validation

Hi all,
In one of my web dynpro's I set the date format to yyyyMMdd. When i push a button there's automatic validation of the date and he complains about the format: The error message i get is: Enter the value in the format 19871125 and my entered date is 20070827 ...
When i select the date from the date picker, he puts it in the correct format, but the validation keeps failing. When i set format to yyyy.MM.dd for example, the validation does not fail.. Is this some kind of bug or is there a logical explanation for this?
Kind regards,
J.

Hi,
I'm setting the format programatically...
When i check locale in web dynpro content it says the following about the current session:
Current locale: en
Default VM locale: en_US
Kind regards,
J.

Similar Messages

  • How to remove the date format validation done by the UI

    Hi All,
    I am having a date field which is an input field for Dateof Birth. User can either select from the calendar or enter his own date. If the user enters invalid date format'(032342525') something like this, when we move to the next tab the column turns to Red and it displays a message saying that date is not a valid date. I wanted to validate that on Save instead of tab click.
    Can anyone of you tell me how can we remove this date format validation in Java Webdynpro.
    Thankyou for your time and consideration!
    Madhavi

    Thankyou for your reply. I cannot the change the date type to string bcas the users need date picker to select the date. The problem I am having is once the format is wrong and the UI validates, though the other fields are entered by the user the application returns error saying that the required field are not entered.
    And also I am having multiple containers in my view set and for all other error messages I am using a popup to display the messages and this only error is shown at the bottom of the page which the users does'nt like.
    Is there any way I can identify that format error occured before it throws on the UI screen??
    Regards,
    Madhavi

  • Urgent !!! Date Format Validation Problem

    hi,
    I'm using the following code to validate a date,
         SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
         String dateStr = "03/30/20xx";
         try{
              sdf.setLenient(false); // For Strict Validation.
              System.out.println(sdf.parse(dateStr));     
              System.out.println("Valid Date " + dateStr);
         }catch(Exception ex){
              System.out.println("Invalid Date " + dateStr);
    It works fine for input values like 03/30/2005, 03/30/xxxx, 03/3x/2005
    but fails for 03/30/20xx.
    where c is any non-numeric character.
    Please tell me a solution for this. Is there any other way to do this.

    Oh! Now I understand!
    try this:
    SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
    String dateStr = "03/30/20xx";
    try {
         sdf.setLenient(false); // For Strict Validation.
         ParsePosition pos = new ParsePosition(0);
         System.out.println(sdf.parse(dateStr, pos));
         System.out.println("Valid Date " + dateStr + " up to position " + pos.getIndex());
    } catch (Exception ex) {
         System.out.println("Invalid Date " + dateStr);
    }

  • Acrobat 9.3.4 doesn't enforce Date Formating

    After we upgraded to Acrobat 9.3.4 from a previous version of 9.3 acrobat doesn't enforce date formating..before in a Text field formated as Date mm/dd/yyyy it would autocompelete if we typed in 9/21 to 9/21/2010.. now it doesn't, we can type any random text in the field and it isn't validated.
    Ideas?

    Just checked, its enabled.. when I say validate I'm referring to Acrobat's internal date format validation, not JavaScript.
    For example if you create a text box, goto properties, format tab, format category = date, date options mm/dd/yyyy
    now if you type:
    "abcdef" in that text box it should say, "Invalid Date/time: please ensure that the date/time exists.
    if you type 9/21 it will automatically turn it into 9/21/2010.
    After Appling the 9.3.4 update no such validation takes place, any value entered is accepted..

  • Generic Date Format

    Hi Folks,,
    I am using regex in my java code ..i need to specify the date as generic format...i tried with some cde ..i ned your suggestions whether is it correct..am i going in right path??
    Dated<space><DateFormat>
    Here is my java code:
    Matcher Assetdate=Pattern.compile(("Dated\\s*|\\d*/\\d*/\\d*|\\w*-\\d*-d*"),Pattern.CASE_INSENSITIVE).matcher(line1);
                while(Assetdate.find()){
                System.out.println(Assetdate.group());
                                        }Thanks.

    If you want to support all date formats valid in an XML document use XMLGregorianCalendar to parse dates:
    [http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/datatype/DatatypeFactory.html#newXMLGregorianCalendar(java.lang.String)]
    -Puce

  • Jquery Date Picker Validation - format issue

    Hi ,
    I am using 2 text items with Jquery dateicker for start date and end date items.
    I have to now write a JS validation to ensure start date <= end date.
    The dateformat of my items are 'd-M-yy' (02-Mar-2010) .....
    When I try to use the Date.parse() function , it gives me an invalid date error....
    If I change the date format to mm/dd/yy (03/02/2010) then there is no problem, I can use Date.parse() and compare the two dates, I get no error . However I need the date format to be : 02-Mar-2010
    Below is a simple version of the JS function Iam using to compare dates and alert error
    function f_validate()
    var a = $v('P1_START_DATE');
    var b = $v('P1_END_DATE');
    var startDate = new Date();
    var endDate = new Date();
    startDate = Date.parse(a);
    endDate = Date.parse(b);
    // if I alert() startDate or endDate it says invalid date
    if (startDate>endDate){
    alert('error');
    else
    doSubmit();
    } Has anybody done a similar validation with Jquery datepickers in the format 'd-M-yy' ?
    Also how Can I use $.datepicker.parseDate function within my Javascript function so that I can convert the dates to the default format and then compare them....
    Appreciate any ideas/pointers
    Thanks,
    Dippy
    Edited by: Dippy on Mar 2, 2010 12:42 AM

    I've used the following without problems:
       var gasDay = $v('P0_GAS_DAY');
       var gasDayDate = new Date();
       gasDayDate = $.datepicker.parseDate('dd-M-yy', gasDay,
          monthNamesShort : ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC']
       );

  • Validating JTextField for Date Format

    hello,
    everybody.
    i am trying to perform a validation on text field, i.e if the input is in a date format then it will show, other wise it will consume the character.
    please help me out of this problem i am stucked with it.
    waitng for reply. the following is my code.
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import java.text.*;
    public class RilJDateField implements KeyListener
         JFrame frame;
         JPanel panel;
         JLabel label;
         JTextField text;
         GridBagLayout gl;
         GridBagConstraints gbc;
         Date date = new Date();
         public static void main(String a[])
              new RilJDateField();
         public RilJDateField()
              panel = new JPanel();
              gl = new GridBagLayout();
              gbc = new GridBagConstraints();
              panel.setLayout(gl);
              label = new JLabel("Only Date Format");
              text = new JTextField(5);
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 1;
              gbc.gridy = 1;
              gl.setConstraints(label,gbc);
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 2;
              gbc.gridy = 1;
              gl.setConstraints(text,gbc);
              panel.add(label);
              panel.add(text);
              text.addKeyListener(this);
              text.requestFocus();
              frame = new JFrame("RilJDateField Demo");
              frame.getContentPane().add(panel);
              frame.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent we)
                             System.exit(0);
              frame.setSize(300,300);
              frame.setVisible(true);
         public void keyTyped(KeyEvent ke)
         public void keyPressed(KeyEvent ke)
              DateFormat df;
              df = DateFormat.getDateInstance();
              df = (DateFormat) ke.getSource();
              if(!(df.equals(date)))
                   ke.consume();
         public void keyReleased(KeyEvent ke)
    }

    hi,
    thanks very much, u gave me great idea.
    according to ur suggestion i used JFormattedTextField as well as SimpleDateFormat, but while giving keyevent i am getting the error,
    so please if possible reply for this.
    the error is
    java.lang.ClassCastException
         at RilJDateField.keyTyped(RilJDateField.java:61)
         at java.awt.Component.processKeyEvent(Unknown Source)
         at javax.swing.JComponent.processKeyEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
         at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)and my source code is
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import java.text.*;
    public class RilJDateField implements KeyListener
         JFrame frame;
         JPanel panel;
         JLabel label;
         JFormattedTextField text;
         GridBagLayout gl;
         GridBagConstraints gbc;
         Date date = new Date();
         SimpleDateFormat formatter;
         public static void main(String a[])
              new RilJDateField();
         public RilJDateField()
              panel = new JPanel();
              gl = new GridBagLayout();
              gbc = new GridBagConstraints();
              panel.setLayout(gl);
              label = new JLabel("Only Date Format");
              text = new JFormattedTextField();
              text.setColumns(10);
              formatter = new SimpleDateFormat("dd mm yyyy");
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 1;
              gbc.gridy = 1;
              gl.setConstraints(label,gbc);
              gbc.anchor = GridBagConstraints.NORTHWEST;
              gbc.gridx = 2;
              gbc.gridy = 1;
              gl.setConstraints(text,gbc);
              panel.add(label);
              panel.add(text);
              text.addKeyListener(this);
              text.requestFocus();
              frame = new JFrame("RilJDateField Demo");
              frame.getContentPane().add(panel);
              frame.addWindowListener(new WindowAdapter() {
                        public void windowClosing(WindowEvent we)
                             System.exit(0);
              frame.setSize(300,300);
              frame.setVisible(true);
         public void keyTyped(KeyEvent ke)
              Date date = (Date) ke.getSource();
              if(!(date.equals(formatter)))
                   ke.consume();
         public void keyPressed(KeyEvent ke)
         public void keyReleased(KeyEvent ke)
    }

  • 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.

  • How to programmatically set formatted javascript dates for validation?

    How does one programmatically set formatted javascript dates for validation?
    "12/31/2011" does not seem to work?

    ourDate.rawValue = "2011-12-31";  // works
    NOTE:  if you have a hierarchy issue you may need something like
    root.body.table.detail.ourDate.rawValue = "2011-12-31";

  • 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

  • Date Field validation in APEX 4.0

    Hi,
    I am using APEX 4.0 for developing my application. I have an SEARCH region in which I have an DATE item with format MM/DD/YYYY. When I enter the date with any junk characters like 'XXXXXXX' then it throws me an validation as "Invalid Date Format" message both in Notification and Inline (Below date Item). This is an APEX 4.0 inbuilt validation for date field and its not the validation created by me in that page explicitly.
    My Issue is that I do not want to Display the validation message inline to the field and I need the message only in Notification. What setting I need to do in Date Item to remove the inline validation message form that field.
    Thanks in Advance

    Hi,
    In your validation process, under the error message section
    (i.e) in the error message display location: set inline in notification give this,
    so that the notification will be fired only in message, not inline to the field.
    Regards,
    Mini
    Mark Answers Promptly

  • How to handle Multiple date formats for the same date field in SQL*Loader

    Dear All,
    I got a requirement where I need to get data from a text file and insert the same into oracle table.
    I am using SQL*Loader to populate the data from the text file into my table.
    The file has one field where I am expecting date date data in multiple formats, like dd/mon/yyyy, yyyy/dd/mon, yyyy/mon/dd, ,mm/dd/yyyy, mon/dd/yyyy.
    While using SQL*Loader, I can see Loading is failing for records where we have formats like yyyy/dd/mon, yyyy/mon/dd, mon/dd/yyyy.
    Is there any way in SQL*Loader where we can mention all these date formats so that this date data should go smoothly into the underlying date column in the table.
    Appreciate your response on this.
    Thanks,
    Madhu K.

    The point being made was, are you sure that you can uniquely identify a date format from the value you receieve? Are you sure that the data stored is only of a particular limited set of formats?
    e.g. if you had a value of '07/08/03' how do you know what format that is?
    It could be...
    7th August 2003 (thus assuming it's DD/MM/RR format)
    or
    8th July 2003 (thus assuming it's MM/DD/RR format)
    or
    3rd August 2007 (thus assuming it's RR/MM/DD format)
    or
    8th March 2007 (thus assuming it's RR/DD/MM format)
    or even more obscurely...
    3rd July 2008 (MM/RR/DD)
    or
    7th March 2008 (DD/RR/MM)
    Do you have any information to tell you what formats are valid that would allow you to be specific and know what date format is meant?
    This is a classic example of why dates should be stored on the database using DATE datatype and not VARCHAR2. It can lead to corruption of data, especially if the date can be entered in any format a user wishes.

  • How to change the date format from default to mm-dd-yyyy?

    Hi,
    There is a requirement to show the current date in an error message at the attribute level. That is, if the user input a date in a text field that is earlier than today's date, then an error message must immediately pop up with today's date in the message. To achieve this we are using a token expression in the EO ( Under Validation rules) . The token expression uses adf.currentDate to get today's date.
    The problem is that the expression extracts the date in the form of yyyy-mm-dd. What expression should I use to get the current date format in mm/dd/yyyy ? Can I modify the adf.currentDate expression in some way to get the desired format?
    Thanks,
    Anand

    You could write a custom EO method to return today's date in the specific format. Then access it via the Groovy adf.object expression.

  • Error in date format when  I load a CSV file

    I am using Oracle G10 XE and I am trying to load data into my database from comma separated files.
    When I load the data from a CSV file which has the date with the following format "DD/MM/YYYY", I received the following error "ORA-01843: not a valid month".
    I have the NSL_LANG set to AMERICAN. I have tried the following command: "ALTER SESSION SET NLS DATE FORMAT="DD/MM/YYYY" and this does nothing. When I try to run "SELECT SYSDATE "NOW" FROM DUAL;" I get the date in this format "10-NOV-06".
    I will appreciate any help about migrating my data with date fields in format DD//MM/YYYY.
    Sincerely,
    Polonio

    See Re: Get error in date when I load a CSV file

  • Not able to save date column with custom date format. in OBIEE 11g

    Hi,
    I have migrated one report from OBIEE 10g to 11g. There is a date column with customized date format(i.e. Default format is 'dd-MMM-yyyy' and I have used 'MMM-yyyy').
    But when I use this custom format and try to save the report in 11g its giving this below error.
    ''Catalog object privilege validation failed for user to path /shared/ALM BI/Finacial Results/History Income Statement Detail.
    You do not currently have sufficient privileges to save a report or dashboard page that contains HTML markup.
    This HTML might be present in column headings, table headings, text views, narrative views, the print header,
    or the print footer and must be removed before saving.''
    Please let me know what changes I need to do for this.
    Regards,
    Ambika Nanda.

    Hi ,
    privilage issues...check the security settings once..
    Thanks,
    Ananth

Maybe you are looking for

  • Project Management Wishlist (hoping for software or online solutions)

    hi all. i've converted the office to mac over the last two plus years and need to put a second level of organization to bed. would anyone mind helping me find other websites and/or suggestions on how to get this finalized? apologies for the length an

  • Comparing files in two folders to find duplicates using part of file name

    I'm not sure if this is something Automator or perhaps Terminal can do, hoping someone might be able to offer guidance or suggestions. I have two folders filled with files of photographs. First folder has approx 15,000 files. Second folder has approx

  • Call to WPG_SESSION API Failed. Error-Code:20000

    Hi, to be short: Oracle: 8.1.7.0.0 When trying to login to the portal application I got this error [bottom of message] I downloaded the diag tool and run it against my configuration, everything was reported OK. I've also searched all through this for

  • WebDynpro Application View

    Hi Guys, We create WebDynpro application  that contains three views. We want to publish each view to a portal iview.But when we create WebDynpro iview , it only shows the application default view.How can we show the other two views as iview in the po

  • Jars dependent on different versions of the another jar

    I have two vendor supplied jars that are both dependent on different releases of another jar. So, in the usage instructions for the first jar, it says to make sure that x_1_2_1.jar is my classpath. Likewise, in the usage instructions for my other jar