Changable Date Format

visolveemr wrote on Thursday, January 10, 2013:

Hi Marine,

Thanks for trying out the code. We did some base level modifications in that commit.
New committed path is : https://github.com/visolve-openemr/openemr/commit/7bf3eb314e7c02b2930896b94e10f450e8969de5

Now it only works fully for the patient’s encounter. This is the Trail commit for getting the approval from the community to continue further. (By ViSolve for MI2)
This requires code changes in all over the code base (where ever required this change).

Thanks,
Ranjith

mariesopenemr wrote on Thursday, January 10, 2013:

Hi Ranjith,

Could you please guide me to fix date format in calendar module.

Any idea?

Thanks,
Maries

visolveemr wrote on Thursday, January 10, 2013:

Hi Maries,

For the calender module (interface/main/calendar),

where ever “ifFormat:”%Y-%m-%d" is used, replace this with “ifFormat:“useGlobals”” (Refer forms/newpatient/common.php in my recent commit)

This will help to show the dates in the format selected from the globals.

Suppose we tried to insert the values(with changed format), it should not save in the DB with desired format.

So we need to modify all the insert queries " Date" variable.

-$date  = formData(‘form_date’);     -->   +$date  = DateToYYYYMMDD(formData(‘form_date’));

( Refer /forms/newpatient/save.php in this commit https://github.com/visolve-openemr/openemr/commit/e7a0cc2c2b45a1bef0a3a35a49a5a1f236aa59f4
).

Before trying this,you need to merge our recent commit in your existing files.

We didn’t tried out this yet. Will be doing this soon. if you tried this early, share your output :slight_smile:

Thanks,
Ranjith

bradymiller wrote on Thursday, January 10, 2013:

Hi Ranjith,

This appears to work very nicely. so basically need three items to work (correct me if mistaken):
1.Precede display to screen with oeFormatShortDate()
2.Calendar.setup javacript item with ifFormat:“useGlobals”
3.Precede save to database with DateToYYYYMMDD()

Looks like ready to integrate into the codebase and for you to begin the code walk through. One more quick question is how it will manage date and time entries?

-brady
OpenEMR

visolveemr wrote on Friday, January 11, 2013:

Hi Brady,

Yes . Your point’s are right.
We did some changes in the code to support  “data time” also.

We committed the changes in the following link.
https://github.com/visolve-openemr/openemr/commit/11408c2ea39bb636c9709a25f664fd1ac3e74edb

We have modified to change the date and also the time format based on the setting in Globals. There is no need for specifying anything different in the ifFormat for the time format changes. We have implemented this in the encounter form for testing.

Kindly share your views.

Thanks,
Ranjith

bradymiller wrote on Saturday, January 12, 2013:

Hi Ranjith,

This looks and tests really nicely. Kudos on coming up with a elegant solution that has eluded us developers for many years. I think your code is ready to implement. I suggest placing an entry in the following wiki page going over the above three steps to implement (along with including the formatting.inc.php script) for developers:
http://www.open-emr.org/wiki/index.php/Development_Policies
(could create a ‘Localization’ section or something like that)

Just point us towards your code when your ready to start committing code to the official codebase (above is basically almost ready, except just need to remove the time example you have in the encounter form; when you do this just let me know and I’ll package up the commits into one and commit it).

thanks,
-brady
OpenEMR

bradymiller wrote on Friday, November 08, 2013:

Hi Visolve,

Just checking on status of this(assuming it stalled out)?

-brady
OpenEMR

openemrdev wrote on Saturday, December 28, 2013:

Hi Visolve,

Is change format is ready to go live…

Thanks,

visolveemr wrote on Monday, December 30, 2013:

Hi

We’ve implemented the changes only to the encounter section and may need some customization for other sections.

Thanks
OpenEMR Customization/Support provider,
ViSolve Inc
services@visolve.com