Parser cannot handle leap years? simpler example

Here is a simpler example. If you change the <aDate> to 2001-02-29 the instance document still validates. However 2001-02-30 fails, as it should and 2001-02-28 validates, as it should.
The schema, d.xsd:
<?xml version = "1.0" encoding = "UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
targetNamespace="http://localhost/d"
elementFormDefault="qualified">
<element name="example">
<complexType>
<sequence>
<element name="aDate" type="xsd:date"></element>
</sequence>
</complexType>
</element>
</xsd:schema>
and the instance document d.xml with an incorrect date:
<?xml version = "1.0" encoding = "UTF-8"?>
<example xmlns="http://localhost/d"
xmlns:xsd="http://www.w3.org/2000/10/XMLSchema-instance"
xsd:schemaLocation="http://localhost/d
http://localhost.emv2.com/1914/d.xsd">
<aDate> 2001-02-29</aDate>
</example>
I used the XSDSample.java file provided with the xdk9 for validation.
Any ideas?
Thanks,
-Stephen

I've tried 9.0.2 beta and I get the same behaviour.
I can also reproduce the same behaviour by taking the catalogue.xml and cat.xsd example in the xdk/demo/java/schema directory.
I changed the Date element type from "year" to "date" and modified the <Date> elements in catalogue.xml appropriately (e.g. 1954-02-28 instead of just 1954).
I get the same behaviour, Feb. 29 always passes validation no matter what year, Feb. 30 always fails:
Here's what it says when it fails on Feb. 30
file:/tmp/xdk92/xdk/demo/java/schema/catalogue.xml<Line 14, Column 40>: XSD-2025: (Error) Invalid text '1977-02-30' in element: 'Date'
Parser Exception: Invalid text '1977-02-30' in element: 'Date'
I'm using the Linux versions, if that makes a difference.
Also, I've tried referencing the xml instance two ways, via a file reference /home/ssimm...
and via a URL http://localhost/.... The behaviour is consistent. (I don't think this should make a difference, I'm just trying to get the behaviour to change)
Any ideas?
Thanks,
-Stephen

Similar Messages

  • Bug or error when handling leap years with WDS/DS

    Hi all,
    I discovered a difference in outcome with Build and Debug (without screens) and Build and Debug with Web Determinations or Determinations Server when calculating days within leap years.
    I use the function DayDifferenceInclusive to calculate the amount of days in an insurance period.
    the amount of days of the insurance period = DayDifferenceInclusive(the start date of the insurance, the end date of the insurance)
    With the regression tester or Build and Debug (without screens) I get the following outcome for the following input:
    *93 = DayDifferenceInclusive(02-29-2008, 05-31-2008)*
    When we use Web Determinations or Determinations Server we get the value of *92* for the exact same input data when it should be 93.
    Is this a bug in the java code? How can we fix this or is there a work around for it?
    We're in the middle of System Integration Testing for a huge project so help is much appreciated!
    Best regards,
    Niels Roest

    Niels,
    thanks for that - and it looks like in the Netherlands daylight savings started on the 30th of March 2008, which as far as I know is the trigger for this error.
    I have reproduced the issue against 10.1 using the period 01 October 2010 to 30 October 2010, which contains the date that daylight saving started in Australia.
    As for ways to work around the issue, I can offer 3:
    * wait for 10.2 - it's in beta at the moment (though given your opening comments, this might not be an option for you)
    * set your server locale to one that doesn't have DST
    * work around the issue in rules:
    Firstly, the issue is that the shipping version fails because it doesn't take into account that one of the days is shorter than the standard 24 hours.
    The trick is to replace the DayDifference function with the HourDifference function and round to the nearest number of days.
    So given a rule that looks like:
    the result = DayDifference(date one, date two)
    it can be rewritten as:
    The result = round(HourDifference(date one at 00:00:00, date two at 00:00:00) / 24, 0)
    * the whole "at 00:00:00" is necessary because HourDifference works on datetimes, not dates.
    Sorry for the hassle.
    Regards
    Andrew

  • How to handle leap year date in the query ?

    Dear Exparts,
    Hope you are fine.
    Here is my banner,
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - ProdI have a date field name birth_date where i store date of birth. I need to pick date of birth in a given range. For example
    BIRTH_DATE
    01-FEB-1980
    12-FEB-1984
    29-FEB-1992
    01-MAR-1986
    01-APR-1986
    22-APR-1988
    01-MAR-1992My searching parameter is
    brith_date between 01/02/13 and 01/04/13I want the record
    01-FEB-1980
    12-FEB-1984
    29-FEB-1992
    01-MAR-1986
    01-APR-1986Here is the script
    create table
    CREATE TABLE DATE_OF_BIRTH
      BIRTH_DATE DATE
    );data insert
    insert into DATE_OF_BIRTH
    values(to_date('01-FEB-1980','DD-MON-RRRR'));
    insert into DATE_OF_BIRTH
    values(to_date('12-FEB-1984','DD-MON-RRRR'));
    insert into DATE_OF_BIRTH
    values(to_date('29-FEB-1992','DD-MON-RRRR'));
    insert into DATE_OF_BIRTH
    values(to_date('01-MAR-1986','DD-MON-RRRR'));
    insert into DATE_OF_BIRTH
    values(to_date('01-APR-1986','DD-MON-RRRR'));Thanks in advance... (thanks to Frank Kulash)
    ask2Learn
    Edited by: Asked to Learn on Feb 24, 2013 7:40 PM

    Hi,
    Asked to Learn wrote:
    Dear Exparts,
    Hope you are fine.
    Here is my banner,
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - ProdI have a date field name birth_date where i store date of birth. I need to pick date of birth in a given range. For example
    BIRTH_DATE
    01-FEB-1980
    12-FEB-1984
    29-FEB-1992
    01-MAR-1986
    01-APR-1986
    22-APR-1988
    01-MAR-1992My searching parameter is
    brith_date between 01/02/13 and 01/04/13I want the record
    01-FEB-1980
    12-FEB-1984
    29-FEB-1992
    01-MAR-1986
    01-APR-1986Here is the script
    create table
    CREATE TABLE DATE_OF_BIRTH
    BIRTH_DATE DATE
    );data insert
    insert into DATE_OF_BIRTH
    values('01-FEB-1980');
    insert into DATE_OF_BIRTH
    values('12-FEB-1984');
    insert into DATE_OF_BIRTH
    values('29-FEB-1992');
    insert into DATE_OF_BIRTH
    values('01-MAR-1986');
    insert into DATE_OF_BIRTH
    values('01-APR-1986');
    You defined the column as a DATE, which is correct, but you're trying to insert VARCHAR2 values, such as '01-FEB-1980' into that column.
    Use TO_DATE to convert a VARCHAR2 into a DATE:
    insert into DATE_OF_BIRTH (birth_date)
    values ( TO_DATE ('01-FEB-1980', 'DD-MON'YYYY'));or use DATE literals:
    insert into DATE_OF_BIRTH (birth_date)
    values ( DATE '1980-02-01);The same goes for queries.

  • Unable to generate the file report pdf on 29 february 2012 or during any leap year day...

    hii this is manab......
    sir/mam i have face the following error in 29 february 2012 for my overall company report .But i can easily get the
    report of another department on 29feb 2012....but when i try generate the overall report of my comapany then i find the errors
    REP-1401: 'cf_mc_prod_lyrformula': Fatal PL/SQL error occurred.
    ORA-01839: date not valid for month specified
    The following is the logfile.........
    ...........................................................................................log file................................................................................................................
    HPCL Custom Application: Version : UNKNOWN
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    HPCCMDS module: HPC Modified CMD Report
    +---------------------------------------------------------------------------+
    Current system time is 04-SEP-2013 11:37:20
    +---------------------------------------------------------------------------+
    +-----------------------------
    | Starting concurrent program execution...
    +-----------------------------
    Arguments
    P_MILL='NPM'
    P_TRANSACTION_DATE='2012/02/29 00:00:00'
    Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are :
    American_America.US7ASCII
    REP-1401: 'cf_mc_prod_lyrformula': Fatal PL/SQL error occurred.
    ORA-01839: date not valid for month specified
    Report Builder: Release 6.0.8.24.0 - Production on Wed Sep 4 11:37:20 2013
    (c) Copyright 1999 Oracle Corporation.  All rights reserved.
    Enter Username:
    +---------------------------------------------------------------------------+
    Start of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    +---------------------------------------------------------------------------+
    End of log messages from FND_FILE
    +---------------------------------------------------------------------------+
    Program exited with status 1
    Concurrent Manager encountered an error while running Oracle*Report for your concurrent request 11426643.
    Review your concurrent request log and/or report output file for more detailed information.
    +---------------------------------------------------------------------------+
    Executing request completion options...
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed
    Current system time is 04-SEP-2013 11:59:23
    +---------------------------------------------------------------------------+
    kindly give me solution .....i have e-business suite 11i
    internet explorer latest version...

    Hi,
    Please confirm whether this is a custom or standard report.
    If this is a custom report, then probably the respective issue has not been handled by exception handling.
    Also please refer note:
    How to check if version 11.5.10.2 is certified to Handle Leap Years (Doc ID 549937.1)
    Thanks &
    Best Regards,

  • Coherence cannot handle year in dates of 9999 ?

    Hi,
    I have been running into an issue with dates in coherence. We have some data which specifies a date of 01/01/9999 to indicate that the date does not expire.
    However this results in errors when loading into coherence as follows:-
    java.io.IOException: year is likely out of range: 9999
    I then found this related thread:-
    Storing large DateTime values from .NET
    Is it really true that coherence cannot handle a valid date ???? Why would you possibly validate a year in the first place given 9999 is actually a valid year !.
    TIA
    Martin

    Hi,
    What is the code that causes the error? What version of Coherence are you using?
    I can serialize/deserialize the date you have without seeing any problems. For example...
    Calendar c = Calendar.getInstance();
    c.set(9999, Calendar.JANUARY, 1);
    Date d = c.getTime();
    ConfigurablePofContext pofContext = new ConfigurablePofContext("coherence-pof-config.xml");
    Binary b = ExternalizableHelper.toBinary(d, pofContext);
    Date d2 = (Date) ExternalizableHelper.fromBinary(b, pofContext);
    System.out.println(d2);The above code works fine when I ran it with Coherence 3.7.1.6
    If I have a class that implements PortableObject with a date field set to 1/1/9999 this also serializes without any problems.
    JK

  • Can't get "Simple Example Doclet" to run -- Cannot find

    I am trying to run the "Simple Example Doclet" at http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/overview.html.
    It appears to compile ok, but when I go to run it I get the message "javadoc: Cannot find doclet class ListClass".
    Listed below is:
         1. The execution command and error message
         2. The version (output of javadoc -J-version)
         3. The javac compile command and input and output files
    All directories have been kept the same as in the example.
    Any help would be appreciated.
    Thanks
    1. C:\jdk1.3>javadoc -doclet ListClass -classpath C:\jdk1.3\lib\tools.jar MyClass.java
    javadoc: Cannot find doclet class ListClass
    1 error
    2. javadoc -J-version
         gives
              java version "1.3.1_01"
              Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
              Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode).
    3. javac -classpath C:\jdk1.3\lib\tools.jar ListClass.java
         appears to give good compile ....
              e. g. Input source file ListClass.java is as follows:
                   import com.sun.javadoc.*;
                   public class ListClass {
                   public static boolean start(RootDoc root) {
                   ClassDoc[] classes = root.classes();
                   for (int i = 0; i < classes.length; ++i) {
                   System.out.println(classes);
                   return true;
              and.....
              decompiled ListClass.class file is as follows:
                   // Decompiled by DJ v2.8.8.54 Copyright 2000 Atanas Neshkov Date: 10/11/2001 4:09:46 PM
                   // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
                   // Decompiler options: packimports(3)
                   // Source File Name: ListClass.java
                   import com.sun.javadoc.RootDoc;
                   import java.io.PrintStream;
                   public class ListClass
                   public ListClass()
                   public static boolean start(RootDoc rootdoc)
                   com.sun.javadoc.ClassDoc aclassdoc[] = rootdoc.classes();
                   for(int i = 0; i < aclassdoc.length; i++)
                   System.out.println(aclassdoc[i]);
                   return true;

    Sorry to be so late in getting back to you .. I was on vacation.
    ListClass is in the current directory. I did get it to work however... In order to get it to work I had to do two things:
    1. use -docletpath (even thought it was in the current path) e. g. -docletpath C:\jdk1.3\ListClass.jar
    AND
    2. Make the class file a jar file -- I could not get it to work otherwise.
    p.s. the typo was a decompiler error.

  • Handling weeks in Planning with leap years

    How are people handling weeks-based forecasting in Planning?
    I have a Planning app that has 53 time periods with an extra week in August to handle the leap year (thus the 53). There are dynamically calculated months, quarters, and the always-loved YearTotal in Time as well.
    This works fine in a leap year, but is kludgy otherwise as it includes an additional month in August – this skews form spreads.
    And it gets even uglier when calculating/data viewing year over year forms as the start week for September should vary across leap and non-leap years.
    It occurred to me that I could create a custom dimension called “Weeks” with all 53 weeks and then use a nested dimension strategy that combined a 12 months Time dimension and the relevant weeks (some hard coding there on forms). I could then use the form column/row suppression to show/hide weeks by month.
    The upsides:
    1)     Smaller block size, as Weeks would go sparse and Time would get reduced from 53 to 12 members.
    2)     True week/month relationships in reporting/forms through prepopulated data and suppression.
    3)     True 4-4-5 spreads to months (although an algorithm to spread to the separate Weeks would have to exist, but that is irrespecitive of the 4-4-5 spread). NB -- 445, etc., concepts don't work in a Planning app with weeks.
    I see a few downsides to this:
    1)     The possibility of entering data by week into the wrong month <-- Form construction could mitigate this.
    2)     Block creation issues in calcs as there is another sparse dimension to take care of.
    3)     Many more blocks <-- How about 53 of them?
    Any thoughts on this approach? I’m not scared of the calcs although I appreciate it’s a little more complicated. I don’t think it breaks the Scenario dimension’s opening/closing of periods. I guess I’m trying to see if there are any hidden issues with this approach and if anyone has figured out a better way to do this.
    Thanks,
    Cameron Lackpour

    The Calendar Component does take account of the leap year.
    If you look at the code, it has
    if ((month == FEBRUARY) && (isLeapYear(year))) numCells++;Not sure what went wrong. I'll take a look at it.
    - Winston

  • Leap Year Handling

    Hi All,
    I just want to get the exactly one year previous date by using the below query: for the leap year...
    update day
    SET FLAG = 'Y'
    WHERE PERIOD_DATE BETWEEN TRUNC(ADD_MONTHS(TO_DATE(20050228,'YYYYMMDD'),-12),'MON') and
    ADD_MONTHS(TO_DATE(20050228,'YYYYMMDD'),-12)
    In the same time while we use the same query for the leap year date:
    select * from day
    WHERE PERIOD_DATE BETWEEN TRUNC(ADD_MONTHS(TO_DATE(20080229,'YYYYMMDD'),-12),'MON')
    AND TO_DATE(20080229,'YYYYMMDD') + NUMTOYMINTERVAL(-1,'YEAR')
    I receive the following error - ORA-01839: date not valid for month specified.
    Problem:FLAG was incorrectly set to 'Y' for Feb 29 in 2004 during the report processing of Feb 28 data. Because of this, the extra day of Feb 29 2004 of Sales data was incorrectly being added to a report, thus overstating MTD sales of Feb 28 2004 by one full day. This appears to be caused by the fact that there were 28 days in Feb 2005 and 29 days in Feb 2004 becuase of the leap year. This will not cause problems until the next leap year.
    Can you please give me the resolution of the above.
    Thanks & Regards,
    Satheesh
    Message was edited by:
    user565141
    Message was edited by:
    user565141

    Hi Sateesh,
    I love your question, I have been writting quite often about this.
    ADD_MONTH is not the correct function to use, neither y2m interval.
    First, you need to define what is 2004-02-29 + 1 year. In most laws I found on the net (like majority and retirement policies), a leap-year baby will have his birthday on March 1st in non-leap years. If you have a contract, you must define this too.
    ex:
    update day set flag='Y'
      where period_date between
        trunc(ADD_MONTHS(:d,-12),'MON') and
        case to_char(:d,'MMDD')
          when '0228' then add_months(trunc(:d,'Y'),-12)+58
          else add_months(:d,-12) end;another approach would be
    where to_number(to_char(period_date,'YYYYMMDD')) between
      to_number(to_char(:d,'YYYYMM"00"'))-10000 and
      to_number(to_char(:d,'YYYYMMDD'))-10000;but if you have an index on period_date, the first solution may be more efficient
    Message was edited by:
    Laurent Schneider
    58 not 59
    Message was edited by:
    Laurent Schneider
    depending on how you define 29Feb -1Y, you could add
          when '0229' then add_months(trunc(:d,'Y'),-12)+59

  • Leap Year, Month, determination program

    Hi - it's the learning student again :) Our new assignment is to create a program to determine leap year, month and day information. So basically you enter a year and the program says if it is a leap year. Then you enter a month and the program determines if that month is part of that leap year. And then you enter a day and determine if that day is part of that leap month that is part of that leap year. I have written a program to determine if it is a leap year and to determine that if the month is february it is a leap month, but not if the month is part of that leap year - so I am missing a step. And so it goes for the leap day - I have created the program to read that the 29th is a leap day but not exculsively to the month of february that falls in the leap year. Make sense? Here is my code so far:
    Here are details of the assignment:
    1.Prompt the user for a year using GUI dialogue window.
    a.Remember to give the user clear direction on input requirements.
    i.E.g. "Please enter month as integer 1-12:"
    2.Prompt the user for the month using GUI dialogue window.
    a.Remember to give the user clear direction on input requirements.
    b.** Please note: month must be input as a string, and then converted to an integer for the case statement below. This may require 2 case statements.
    3.Prompt the user for a day in the month.
    a.This must return a message to the user if the month doesn’t include that day.
    b.i.e. entering 30 in a February month should tell the user it is an invalid day and stop execution.
    4.Check to see if the year is a leap year.
    5.Check to see if the month is a leap month.
    6.Check to see if the day is a leap day.
    7.Display a user friendly back to the consumer indicating:
    a.Year entered & If it is a leap year
    b.Month entered & if it is a leap month.
    c.The number of days in the month (e.g. January has 31 days, whereas February has 28 unless it is a leap year.
    d.The day of the month entered & whether or not is a Leap day.
    e.Output can be in three different dialogue windows, or just 1 if desired.
    And here is my code - I am not sure what to do next. It is running and compiling without any errors right now but I know I am missing some steps. Any help or advice in what steps to take next would be appreciated!
    import javax.swing.JOptionPane;
    public class Leap_Year {
         public static void main (String[] args) {
         //Enter a year
         String enterYearString = JOptionPane.showInputDialog("Enter a year: ");
         //Convert year to an integer
         int enterYear = Integer.parseInt(enterYearString);
         // Check if year is a leap year
              boolean isLeapYear =
                        (enterYear % 4 == 0 && enterYear % 100 != 0) || (enterYear % 400 == 0);
         //Enter a month
              String enterMonthString = JOptionPane.showInputDialog("Enter a month as an integer, e.g. 1-12: ");
         //Convert month to an integer
         int enterMonth = Integer.parseInt(enterMonthString);     
         //Check if month is a leap year
                   boolean isLeapMonth =
                             (enterMonth == 2);
         //Enter a day
                   String enterDayString = JOptionPane.showInputDialog("Enter a Day as an integer, e.g. 1-31: ");
         //Convert day to an integer
              int enterDay = Integer.parseInt(enterDayString);     
         //Check if day is a leap day
                        boolean isLeapDay =
                                  (enterDay == 29);          
         //Display the result
         String output = "The year " + enterYear + " is a leap year is: " + isLeapYear +
                   "\nThe month " + enterMonth + " is a leap month is: " + isLeapMonth +
                   "\nThe day " + enterDay + " is a leap day is: " + isLeapDay;
         JOptionPane.showMessageDialog(null,output);
    }

    Ok - so I may have "over-coded" - since I am totally new to programming this might be sloppy. Apologies ahead of time. I have most of the stuff figured out. A couple of problems I am having. When I display my results as to whether or not the month is a leapy year is reads as:
    The year 2012 is a leap year is: true
    The month of February in the year 2012 is a leap month is: true
    How would I go about making it display something simple like:
    The year 2012 is a leap year.
    The month of February in the year 2012 is a leap year. OR
    The year 2013 is not a leap year.
    The month of January in the year 2013 is not a leap month.
    Additionally, I need to write a case statement that would return an error statement if someone tried to enter the wrong number of days in a month (example entering 31 days for the month of February).
    Here is my current code:
    import javax.swing.JOptionPane;
    public class LeapYear2 {
         public static void main (String[] args) {
         //Enter a year
         String enterYearString = JOptionPane.showInputDialog("Enter a year: ");
         //Convert year to an integer
         int enterYear = Integer.parseInt(enterYearString);
         // Check if year is a leap year
              boolean isLeapYear =
                        (enterYear % 4 == 0 && enterYear % 100 != 0) || (enterYear % 400 == 0);
         //Enter a month
              String enterMonthString = JOptionPane.showInputDialog("Enter a month as an integer, e.g. 1-12: ");
         //Convert month to an integer
         int enterMonth = Integer.parseInt(enterMonthString);     
         //Check if month is a leap year
                   boolean isLeapMonth =
                             (enterMonth == 2 && enterYear % 4 == 0 && enterYear % 100 != 0) || (enterYear % 400 == 0);          
         //Enter a day
                   String enterDayString = JOptionPane.showInputDialog("Enter a Day as an integer, e.g. 1-31: ");
         //Convert day to an integer
              int enterDay = Integer.parseInt(enterDayString);     
         //Check if day is a leap day
                        boolean isLeapDay =
                                  (enterDay == 29 && enterMonth == 2 && enterYear % 4 == 0 && enterYear % 100 != 0) || (enterYear % 400 == 0);          
         //Set number of days to a variable
                        int numDays;
         //Calculate the number of days in a month                    
                        if (enterMonth == 2)
                             if (isLeapMonth)
                             numDays=29;
                        else
                             numDays = 28;
                        else if (enterMonth == 1 || enterMonth == 3 || enterMonth == 5 || enterMonth == 7 || enterMonth == 8 || enterMonth == 10 || enterMonth == 12)
                             numDays = 31;
                             else
                                  numDays = 30;
         //Set the name of the month to a variable
                        String month = null;
         //Determine the number association to the name of the month
                        if (enterMonth == 1)
                             month = "January";
                        if (enterMonth == 2)
                             month = "February";
                        if (enterMonth == 3)
                             month = "March";
                        if (enterMonth == 4)
                             month = "April";
                        if (enterMonth == 5)
                             month = "May";
                        if (enterMonth == 6)
                             month = "June";
                        if (enterMonth == 7)
                             month = "July";
                        if (enterMonth == 8)
                             month = "August";
                        if (enterMonth == 9)
                             month = "September";
                        if (enterMonth == 10)
                             month = "October";
                        if (enterMonth == 11)
                             month = "November";
                        if (enterMonth == 12)
                             month = "December";
         //Display the result
         String output = "The year " + enterYear + " is a leap year is: " + isLeapYear + "." +
                   "\nThe month of " + month + " in the year " + enterYear + " is a leap month is: " + isLeapMonth + "." +
                   "\nThe day " + enterDay + " is a leap day is: " + isLeapDay + "." +
                   "\nThe month of " + month + " in the year " + enterYear +" has " + numDays +" days in it.";
         JOptionPane.showMessageDialog(null,output);
    }

  • ICal bug  -- leap year has broken reoccuring events

    Since last week , when there were 29 days in February instead of 28,  events in iCal which are re-occuring  (a meeting which occurs every month on the second Monday for example) is simply wrong.
    It is clear that this is an artifact of "Leap Year." The error compounds.
    In March in was off by one day -- scheduled on Tuesday instead of Monday. In April the error compounds... now scheduled on Friday in April.
    Events which were scheduled by data "appear" to be correct, but now I don't know that I can even trust them.
    This problem propigates through iCloud and infects my iPhone and iPads as well.
    iMac 10.7.3
    iPhone 5.1
    iPad 5.1
    Mac mini 10.6.8
    It turns out this Bug dates back to 2008!!!!!
    https://discussions.apple.com/message/6309125#6309125

    No. not really.
    I spent some time on the phone with Apple support and basically discovered that if I looked at the reoccurring event back in February (the previous month), it showed up correctly as an event being repeated as, in my case, "Custom, Every Month on the first Monday." However, then comparing that entry to the incorrect March entry, I noted the March entry was showing up as repeat "Every Month." (Which translated into every 30 or 31 days, looking at subsequent events.)
    Simply changing the bad March event back to the Custom "Every Month on the First Monday," and then applying it to the forward "worked around" the issue.
    We never did come up with any idea what caused the change. (i.e. the support person could find no references to any kind of similar problem.)
    I was told to go to "www.apple.com/feedback" and to select "iCal" from the list of "OS C Apps" near the bottom of the page, and report the problem.

  • Leap Year Calendar

    I am working on a project where the user enters a year. The string is then converted into an int and goes through a series of tests to see if it is a leap year or not. The problem I am having is when the user inputs letters when they are supposed to enter numbers. This gives the "java.lang.NumberFormatException" error. I used the try and catch code to make the user re input a year, but how do you make that into a loop. I want to make it so if the user keeps putting in letters, the computer keeps asking for numbers.
    this is my code so far:
    import javax.swing.JOptionPane; //import this at top
    public class finding_the_leap_year {
    public static void main(String[]args){
    int year = 0;
    {color:#ff0000}
    try{
    String inputValue = JOptionPane.showInputDialog("Input a year");
    year = Integer.parseInt(inputValue);
    catch(java.lang.NumberFormatException ex){
    while(????????????????????){
    System.out.println("Please enter a year");
    String inputValue = JOptionPane.showInputDialog("Input a year");
    year = Integer.parseInt(inputValue);
    }          }{color}
    if(year % 4 == 0)
    System.out.println(year + " is a leap year.");
    if(year % 100 == 0)
    if(!(year%400==0)){
    System.out.println(year + " is a leap year.");
    else{
    System.out.println(year + " is not a leap year.");
    Edited by: chibioj on Sep 29, 2007 12:50 PM
    Edited by: chibioj on Sep 29, 2007 12:51 PM

    Put more in the while loop. I sometimes use a boolean value such as dataValid or inputValid and set it to false. I only set it to true if the input entered is ok. It is set to true in the try block but AFTER the data is obtained and parsed. The code will only reach that line if the input is valid.
            String inData = "";
            boolean dataValid = false;
            while (!dataValid) // while we don't have a correct answer yet
                try
                    inData = JOptionPane.showInputDialog("Input a number");
                    if (inData != null)  // if they didn't press the cancel button
                        year = Integer.parseInt(inData);                   
                    dataValid = true; // won't get here if numberformatexception tripped
                catch (java.lang.NumberFormatException ex)
                    JOptionPane.showMessageDialog(null, "You didn't enter a valid year.  Please try again.");
            if (inData != null) // if cancel button not pressed on input dialog
                if (......Also, you have some logic errors in the rest of your code that need fixing.
    Good luck!

  • Leap Year Exception in Exit Variable

    Hello Experts,
                           I have a Customer exit variable(ZVAR_PREVIOUS_MONTH) which displays data for previous month of input date. When i am entering 02/29/2008(which is a leap year) as input then the variable throws an error saying "Value "20070229" for user exit varaible is invalid. And thats true since 2007 is not a leap year. So how can i handle this Leap Year Exception
    Regards,
    Vishnu.

    Vishnu,
    Your description doesn't make sense. If you input 2008, why is the error showing 2007? Could you post your code here so we can have a look?
    I think you are trying to implement the exit such that if you supply 02/29/2008, the variable should resolve to 01/01/2008 - 01/31/2008. Is that correct?
    variable-sign = 'I'.
    variable-option = 'BT'.
    * received_value = 02/29/2008
    received_value+6(2) = '01'.                        " 02/01/2008
    variable-high = received_value - 1.            " 01/31/2008
    variable-low = variable-high.                      " 01/31/2008
    variable-low+6(2) = '01'.                             " 01/01/2008

  • Leap year issue in depriciation

    Hi All,
    I have an asset which is acquired on 16th January 2008. 2008 being a leap year should calculate depriciation according to 366 days in a year. However it is calculation on the basis of 365 days in a year. Where should this setting of leap year be maintained so that it starts considering 366 days instead of 365.
    Regards,
    Ajay

    Hi Ajay,
    In transaction OAVH:
    Example
    K4 01 2008 2 29 2             
    K4 01 2009 2 28 2                               
    K4 01 2010 2 28 2                               
    K4 01 2011 2 28 2                               
    K4 01 2012 2 29 2 
    K4 01 2016 2 29 2                               
    regards Bernhard

  • Calculating a Leap Year with a FOX Formula

    Hi to everybody.
    Is it posible to calculate a leap year using BPS in BW 3.5 with a FOX formula?
    The code i need to write is something like this:
    if ((year % 4 == 0) AND ((year % 100 != 0) OR (year % 400 == 0)) then
      it is a leap year;
    else
      it isn´t a leap year;
    endif;
    The problem i have is that my variable year is an standard type 0CALYEAR and I cannot do i.e.
    Year MOD 4, and save this value to an integer because 0CALYEAR and INTEGER are different types of variables.
    Any idea?
    Thanks in advance!
    Edited by: Ivan Lopez on Jan 15, 2008 5:24 PM
    Edited by: Ivan Lopez on Jan 15, 2008 5:24 PM

    Hi,
    Eventhough variable is on the characteristic 0CALYEAR, you can assign the variable value to an integer in FOX.
    Declare a local variable of type integer.
    DATA YEAR TYPE I.
    YEAR = VARV(variable).
    Now you can do MOD operations on YEAR.
    Regards,
    Bindu

  • A simple example of JList

    Dear All
    please send a simple example of JList using Event Handling.
    Thanks in advance.

    Rajsarawat wrote:
    Dear All ...
    Thanks in advance.I love how Rajsarawat conscientiously always comes back to his threads to personally thank folks who contribute. That will surely motivate me to help him as much as possible in the future. Good job, Rajsarawat!

Maybe you are looking for

  • Error message when publishing to Word 2003 from Captivate v5.5

    When trying to publish a project to Word 2003 that was created in Captivate v5.5, the author is getting the following message: Publishing failed. Please ensure that MS Word is installed and that the document is not opened and repeat. (Translated from

  • Box in my garage is beeping all the time

    There is some kind of Verizon Fios head end box in my garage and it is beeping pretty loud every 10 -15 mins or so. Im guessing it is a battery issue or something but not sure of next steps. Please advise.

  • Make video disappear after last frame

    Have embedded a video in a document. Thanks to Ned, I can now stop the video, but I want it to disappear after it's finished. How 2 do? All the Best Slafite

  • Upgrade IDS (4.1- 5.1)

    How to upgrade my IDS 4215 from v4.1 to v5.1? Does my ciscowork be upgraded at same time? Thanks

  • Strange message while booting up.

    I get this message while booting and am wondering if anyone knows how to correct the problem. Not activating Mandatory Access Control now since /sbin/tomoyo-init doesn't exist. I haven't found any solutions or much explanation of what it is using goo