xs:yearMonthDuration

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

xs:yearMonthDuration

bsteuhl
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.
Reply | Threaded
Open this post in threaded view
|

Re: xs:yearMonthDuration

Erik Bruchez
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
Reply | Threaded
Open this post in threaded view
|

Re: xs:yearMonthDuration

bsteuhl
<xforms:setvalue ref="" value="xs:date(end date) - xs:date(begin date)" />

returns a xs:dayTimeDuration data type.
 
Business Email: [hidden email]
Cell: 908-421-0742
Home Office: 732-961-3187
Google Voice: 732-800-1286 (1BTM)
RSS Feed To My Blog:

Business Process Modeling - BTMSoftwareSolutions.com


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
To unsubscribe from xs:yearMonthDuration, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: Re: xs:yearMonthDuration

Erik Bruchez
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:
<xforms:setvalue ref="" value="xs:date(end date) - xs:date(begin date)" />

returns a xs:dayTimeDuration data type.
 
Business Email: [hidden email]
Cell: <a href="tel:908-421-0742" value="+19084210742" target="_blank">908-421-0742
Home Office: <a href="tel:732-961-3187" value="+17329613187" target="_blank">732-961-3187
Google Voice: 732-800-1286 (1BTM)
RSS Feed To My Blog:

Business Process Modeling - BTMSoftwareSolutions.com


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
To unsubscribe from xs:yearMonthDuration, click here.
NAML




View this message in context: Re: xs:yearMonthDuration

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
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: xs:yearMonthDuration

bsteuhl
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.
 
Business Email: [hidden email]
Cell: 908-421-0742
Home Office: 732-961-3187
Google Voice: 732-800-1286 (1BTM)
RSS Feed To My Blog:

Business Process Modeling - BTMSoftwareSolutions.com


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:
<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
Google Voice: 732-800-1286 (1BTM)
RSS Feed To My Blog:

Business Process Modeling - BTMSoftwareSolutions.com


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
To unsubscribe from xs:yearMonthDuration, click here.
NAML




View this message in context: Re: xs:yearMonthDuration

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




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