LOVDnl / LOVD3

LOVD3 development repository
http://www.LOVD.nl
GNU General Public License v3.0
24 stars 4 forks source link

Change pattern for custom columns denoting age to allow ranges #281

Open mkroon1 opened 7 years ago

mkroon1 commented 7 years ago

To allow for uncertainty, we want to allow for age ranges in the age related custom fields.

The regular expression below is currently used on the shared installation:

/^([<>]?\d{2,3}y(\d{2}m(\d{2}d(\d{2}h)?)?)?|\d{2,3}y(\d{2}m(\d{2}d(\d{2}h)?)?)?-\d{2,3}y(\d{2}m(\d{2}d(\d{2}h)?)?)?)?\??$/

This allows for entries in the form of "02y-03y" or "02y12m22d-03y", etc. Also, the legend should be adjusted to include something like the following:

<UL style="margin-top:0px;">
    <LI>35y = 35 years</LI>
    <LI>04y08m = 4 years and 8 months</LI>
    <LI>00y00m01d12h = 1 day and 12 hours</LI>
    <LI>18y? = around 18 years</LI>
    <LI>30y-40y = between 30 and 40 years</LI>
    <LI>&gt;54y = older than 54</LI>
    <LI>? = unknown</LI>
</UL>

Some fields have calculations done on these values; this should be checked.

ifokkema commented 6 years ago

Duplicate of #274.