Why do calculations on dates return only in xs:dayTimeDuration subtype of xs:duration. I need type xs:duration so I can have each part of calculation Year, month and days. Is there a local property I can set. All casts and conversions have failed. Regards B.
|
Administrator
|
Can you provide an example of a calculation?
-Erik On Mon, Aug 6, 2012 at 6:34 PM, bsteuhl <[hidden email]> wrote: > Why do calculations on dates return only in xs:dayTimeDuration subtype of > xs:duration. I need type xs:duration so I can have each part of calculation > Year, month and days. Is there a local property I can set. All casts and > conversions have failed. Regards B. > > > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/xs-yearMonthDuration-tp4655585.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
<xforms:setvalue ref="" value="xs:date(end date) - xs:date(begin date)" /> returns a xs:dayTimeDuration data type. Brian Steuhl Website: http://BTMSoftwareSolutions.com Business Email: [hidden email] Cell: 908-421-0742 Home Office: 732-961-3187 From: Erik Bruchez [via Orbeon Forms (ops-users)] <[hidden email]> To: bsteuhl <[hidden email]> Sent: Wednesday, August 8, 2012 1:04 PM Subject: Re: xs:yearMonthDuration
Can you provide an example of a calculation?
-Erik On Mon, Aug 6, 2012 at 6:34 PM, bsteuhl <[hidden email]> wrote: > Why do calculations on dates return only in xs:dayTimeDuration subtype of > xs:duration. I need type xs:duration so I can have each part of calculation > Year, month and days. Is there a local property I can set. All casts and > conversions have failed. Regards B. > > > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/xs-yearMonthDuration-tp4655585.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws If you reply to this email, your message will be added to the discussion below:
http://orbeon-forms-ops-users.24843.n4.nabble.com/xs-yearMonthDuration-tp4655585p4655599.html
|
Administrator
|
It's per the XPath 2 spec:
There is no property to change this behavior.
It kind of makes sense in a way given the types available in XPath: if you have two dates, you can easily know exactly the difference is number of days. It could to make sense to get a difference that includes months, but you would need a type able to represent years, months, and days. XPath 2 only has yearMonthDuration, which doesn't include days.
-Erik
On Thu, Aug 9, 2012 at 5:22 AM, bsteuhl <[hidden email]> wrote:
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
That is what I assumed and it does make sense and I explained to client that subtracting with results in days is the only way to be accurate. And since you have a start and end date makes sense. For the other requirement of adding durations to a given date I informed them that I could add a duration of Years and then months and then days to a date. This is a criminal justice effort in which they get sentences in Years, Months and Days and then possibly subtract days for time served (credit). Thank you for looking into this. Enjoy upcoming weekend. Brian Steuhl Website: http://BTMSoftwareSolutions.com Business Email: [hidden email] Cell: 908-421-0742 Home Office: 732-961-3187 From: Erik Bruchez <[hidden email]> To: [hidden email] Sent: Thursday, August 9, 2012 8:45 PM Subject: [ops-users] Re: Re: xs:yearMonthDuration It's per the XPath 2 spec: There is no property to change this behavior.
It kind of makes sense in a way given the types available in XPath: if you have two dates, you can easily know exactly the difference is number of days. It could to make sense to get a difference that includes months, but you would need a type able to represent years, months, and days. XPath 2 only has yearMonthDuration, which doesn't include days.
-Erik
On Thu, Aug 9, 2012 at 5:22 AM, bsteuhl <[hidden email]> wrote:
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |