Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

I have added the formula 'datedif', as defined in ODF 1.2 to calc (see diff).

But there are some items I would like to get advise on:
1. parameter fmt in datedif( date1; date2; fmt ) defines the output (d, m, y, yd, ym, md for days, 
months etc). In my code, the users needs to enter "d" (i.e. use the double quotes around). IMHO, 
that is not user-friendly. Can anyone tell me how to solve that?
2. the calculation in DateDif(..) uses mean values for days in year (365.2425) and for days in 
month (30.4369). That will in some instances lead to -seemingly?- incorrect results. Should I do 
something about that, i.e make the code date-concious?
3. The various defined values for paramter fmt (d, m, y, yd, ym, md) are 'hard' in the code ("d", 
"m", "y", "yd", "ym", "md"). This does not look neat to me. is there a preferred way of doing such 
things?
4. Currently, when an undefined value of parameter fmt is passed, the function returns 0 instead of 
an error message tp the user. Can anyone tell me how to implement a correct and user-friendly 
handling of incorrect parameter values?
5. ODF 1.2 defines DATEDIF, but the languages I've seen using this function use DATEDIFF. Why is 
ODF different (or isn't it)?

Thanks for your help!


Winfried


Attachment: 20120426.diff
Description: 20120426.diff


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.