CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Custom Date Format
Pages: [1] 2

Author Topic: Custom Date Format  (Read 3117 times)

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Custom Date Format
June 09, 2010, 06:04:00 am
i want to have my date format as dd/mm/yyyy but in the custom data i only have the option to choose dd-mm-yyyy. is there a way to edit a file somewhere where i can replace the hyphens with front slashes?

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Custom Date Format
June 10, 2010, 03:49:22 am
Quote from: Yoda_Oz on June 09, 2010, 06:04:00 am
i want to have my date format as dd/mm/yyyy but in the custom data i only have the option to choose dd-mm-yyyy. is there a way to edit a file somewhere where i can replace the hyphens with front slashes?

Can you try applying the attached patch and reporting back whether it worked for you?

You can try editing the serialised config object in civicrm_domain.config_backend, but it will be overwritten with one of the other values next time you save the ‘Date Formats’ admin screen.

The problem that I can see with this solution is that for some reason the date fields do not get populated when you re-edit a given form (say, date of birth); this might be a limit of jQuery…
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Custom Date Format
June 10, 2010, 04:00:24 am
ok i edited the file /CRM/Core/SelectValues.php and changed the values that showed dd-mm-yy to dd/mm/yy.

dunno whether this will enough though. ill keep you posted when im playing around later on.

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Custom Date Format
June 10, 2010, 04:05:05 am
ah! when i now try to edit an event it says the end date must be after the start date.
it comes up properly as:
start date: 12/7/10
end date: 19/9/10

it must still think the date is the backwards american version with the months first now.

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Custom Date Format
June 10, 2010, 04:26:15 am
By editing that file you only added (or changed) the options available in the list, you also need to go the admin screen and save. Did you do that?
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Custom Date Format
June 10, 2010, 04:28:41 am
yeah, i went there and saved it. that was the first place i went to check.

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Custom Date Format
June 10, 2010, 05:37:15 am
are there any other files that contain information about the date format to which the form uses to validate?

Piotr Szotkowski

  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Custom Date Format
June 10, 2010, 06:20:59 am
Hm, let me check with Kurund (our jQuery guru) on what the limitations of this settings are – as I mentioned above, in my case I can insert dates in the YYYY/MM/DD format, but when I edit a given content the date inputs are not being populated.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Custom Date Format
June 10, 2010, 06:22:05 am
good stuff. thanks immensely for your help :)

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Date Format
June 18, 2010, 02:08:42 am
Hey sorry for the delay in replying this post. Please check the attached patch and let me know if that works for you. This custom data specific patch.

HTh
Kurund
Found this reply helpful? Support CiviCRM

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Custom Date Format
June 18, 2010, 02:49:32 am
im still getting this error when submitting a form with the date in format dd/mm/yyyy. the date appears correct in the form but it still doesnt seem to like it...:
Code: [Select]
Please correct the following errors in the form fields below:
End date should be after Start date

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Date Format
June 18, 2010, 12:11:59 pm
which page do you get this error?

Kurund
Found this reply helpful? Support CiviCRM

Yoda_Oz

  • I post occasionally
  • **
  • Posts: 107
  • Karma: 2
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Custom Date Format
June 18, 2010, 04:01:21 pm
when creating/editing an event.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Date Format
June 19, 2010, 12:00:10 am
Seems to be working fine for me. I am on 3.2, let me check on 3.1 and get back to you.

Kurund
Found this reply helpful? Support CiviCRM

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom Date Format
June 19, 2010, 12:21:05 am
Can you revert previous patch and apply attached patch. I have tested on 3.1 and is working fine for event and also custom data.

HTh
Kurund
Found this reply helpful? Support CiviCRM

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Discussion »
  • Internationalization and Localization (Moderators: Michał Mach, mathieu) »
  • Custom Date Format

This forum was archived on 2017-11-26.