FpML Issues Tracker

664: cd-33 incorrectly assumes a fixed number of days in a month

April 8, 2008

closed

Minor

Always

Validation Rules

Admin

danieldui

Summary

cd-33 today is: " Context: PeriodicPayment (complex type) cd-33 (Mandatory) If both firstPaymentDate and lastRegularPaymentDate are present, then lastRegularPaymentDate must fall precisely on a date reachable by adding an integer multiple of the period in paymentFrequency to firstPaymentDate. "

Section 4.6.2 of the manual states:

"http://www.fpml.org/spec/fpml-4-4-4-wd-3/html/fpml-4-4-intro.html#s4.6.2 The evaluation of dates in the validation rules is not trivial. The optionality of including time offsets in date datatypes makes comparisons between dates more difficult since sometimes the result is indeterminate as any ISO8601 date is +/- 18 hours of timezone, and +/- 24 hours of day.

The Validation Working Group recommends the use of the XPath 2.0 date/time comparison rules which defines a definitive true / false value even for indeterminate calculations.

The Validation Working Group recommends that time offsets appear on all date/time values used in FpML documents."

Rule cd-33 contradicts those statements. Subtracting one xs:date from another xs:date will result in an xs:dayTimeDuration. Determining the difference in months between two dates is undefined because people may not agree on the answer.

For example, if the Period was "P3M" of type xs:duration of xs:yearMonthDuration it could not participate in arithmetic with an xs:dayTimeDuration, because the operands to the arithmetic operators would be of incompatible types.

This is a spin-off of issue #636

Notes:

  • matthewdr

    04/29/08 1:19 pm

    Agreed at the VWG that Daniel will write out text showing how to step through dates.

  • mgratacos

    10/21/19 11:19 am

    Added the link to the Dates Calculation paper in the Definitions section of the Validation rules.

    The change will be published on version 5.11 Trial Recommendation.

  • Leave an update

    You must be logged in to post an update.