Comparing date recorded as integer with today

Hello,

Apologies, but I'm not really a developer and can't seem to figure
this out.

I'm trying to compare a date read from a part of an integer
(12345220911 for 22 Sep 2011; I'm reading this from a barcode) with
today's date and display a different acknowledgement depending on that
(example: "date is passed", "date is in the next 4 weeks", "date is in
distant future")

Is that possible to do within xforms without the need for modifying
ODK code itself? Would really appreciate any hints.

Cheers!

this is likely possible, but it'd take a lot of xpath code to make it
work. https://groups.google.com/d/topic/opendatakit/9UOCAsJDvXU/discussion
might be a useful place to start, but my intuition is that you'll may
need a dev.

··· On Sun, Sep 4, 2011 at 21:40, Pooya wrote: > Hello, > > Apologies, but I'm not really a developer and can't seem to figure > this out. > > I'm trying to compare a date read from a part of an integer > (12345220911 for 22 Sep 2011; I'm reading this from a barcode) with > today's date and display a different acknowledgement depending on that > (example: "date is passed", "date is in the next 4 weeks", "date is in > distant future") > > Is that possible to do within xforms without the need for modifying > ODK code itself? Would really appreciate any hints. > > > Cheers! > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

Thanks Yaw. I was looking at that myself actually. The link for the
complete version of the form seems to be broken (re: below), any chance
you could put it up again? Cheers!

··· ----

you can see a more complete version of the form at
http://dpaste.com/602640


On 6/09/11 6:04 AM, "Yaw Anokwa" yanokwa@gmail.com wrote:

this is likely possible, but it'd take a lot of xpath code to make it
work. https://groups.google.com/d/topic/opendatakit/9UOCAsJDvXU/discussion
might be a useful place to start, but my intuition is that you'll may
need a dev.

On Sun, Sep 4, 2011 at 21:40, Pooya gpooya@gmail.com wrote:

Hello,

Apologies, but I'm not really a developer and can't seem to figure
this out.

I'm trying to compare a date read from a part of an integer
(12345220911 for 22 Sep 2011; I'm reading this from a barcode) with
today's date and display a different acknowledgement depending on that
(example: "date is passed", "date is in the next 4 weeks", "date is in
distant future")

Is that possible to do within xforms without the need for modifying
ODK code itself? Would really appreciate any hints.

Cheers!

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

sorry about that. try http://pastie.org/2489394

··· On Tue, Sep 6, 2011 at 06:46, Pooya Nikooyeh wrote: > Thanks Yaw. I was looking at that myself actually. The link for the > complete version of the form seems to be broken (re: below), any chance > you could put it up again? Cheers! > > ---- > calculate="if(/data/AgeType='BirthDate', ((now()-/data/BirthDate) div > 30.4375), (if(/data/AgeInMonths > 0, ((/data/AgeInYears * > 12)+/data/AgeInMonths), (/data/AgeInYears * 12))))"/> > > you can see a more complete version of the form at > http://dpaste.com/602640 > > ---- > > > > > > > On 6/09/11 6:04 AM, "Yaw Anokwa" wrote: > >>this is likely possible, but it'd take a lot of xpath code to make it >>work. https://groups.google.com/d/topic/opendatakit/9UOCAsJDvXU/discussion >>might be a useful place to start, but my intuition is that you'll may >>need a dev. >> >>On Sun, Sep 4, 2011 at 21:40, Pooya wrote: >>> Hello, >>> >>> Apologies, but I'm not really a developer and can't seem to figure >>> this out. >>> >>> I'm trying to compare a date read from a part of an integer >>> (12345220911 for 22 Sep 2011; I'm reading this from a barcode) with >>> today's date and display a different acknowledgement depending on that >>> (example: "date is passed", "date is in the next 4 weeks", "date is in >>> distant future") >>> >>> Is that possible to do within xforms without the need for modifying >>> ODK code itself? Would really appreciate any hints. >>> >>> >>> Cheers! >>> >>> -- >>> Post: opendatakit@googlegroups.com >>> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >>> Options: http://groups.google.com/group/opendatakit?hl=en >>> >> >>-- >>Post: opendatakit@googlegroups.com >>Unsubscribe: opendatakit+unsubscribe@googlegroups.com >>Options: http://groups.google.com/group/opendatakit?hl=en > > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >