I would like to find out how I can change the way the date is displayed and entered into mysql. Currently it is being displayed as 2005-12-2 and I would like it to be displayed as 12-02-2005. Is something like this possible?
I am familar with PHP but I’m not familiar with the class files yet. For example, I modified the prescription screen (data entry). There were certain fields which the office doesn’t need. Well, I found the class files that are associated and commented out two fields. Now there are the getters and setter functions (i.e. get_interval, set_interval). well, since I commented those out, there is another library which still has those functions in there which I cant find. the main forms for prescription, they are commented out so I know they do not know about the function anymore. My question is, what other file holds function information?
If I can get this question answered, then i’ll have a better idea on how to fix the date formatting.
I’m not sure offhand, I’d have to go hunting for them. As far as data entry, there are some JavaScript modules in the library directory; see calendar.js and textformat.js.
Hi Rod and others,
For internationalisation reasons we really need to pick up on the date issue. My idea would be to generate a standard date (YYYY/MM/DD; MM/DD/YYYY; DD/MM/YYYY; / or -) based on country code. That will require creating a standard and changing all hard coded date appearances by a variable/function.
standard should be database format or yyyymmdd
and then use a method to translate the date,
possibly using a global config variable
so hdate(yyyymmdd) will flip to output selection,
and if hdate() input is different from yyymmdd can flip to standard
(knowing the config variable)
In the Dutch customized version of the OpenEMR, we’re using an auxiliary function, made to help us displaying these dates.
It’s called dateformat() and it can be found in library/date_functions.php. This function takes (or not) a string as arg and transform it, function of LANGUAGE constant, in a specific date string.
The function is in ‘beta’ state, it needs improvement but it’s a start.
Note: this function is only used to display dates; it doesn’t make the transformation interface -> database (and yes, as Andres said, the standard should be database format).