CRM icon indicating copy to clipboard operation
CRM copied to clipboard

Changing date format according sDate variables

Open saulowulhynek opened this issue 9 years ago • 6 comments

There are some many styles of date arround the world. According https://en.wikipedia.org/wiki/Date_format_by_country, the three most used are:

  • DMY by 3295 milions of people
  • YMD by 1660 milions of people and
  • MDY by 320 millions of people.

So, in localization concept, is necessary flexibilize date format through sDateFormatLong, sDateFormatNoYear and sDateFormatShort variables.

Searching in code, I found:

date_in_code.txt

Values are stored in: config_cfg.cfg_name

Default values are:

  • sDateFormatLong = yyyy-mm-dd
  • sDateFormatNoYear = DD/MM
  • sDateFormatShort = yy-mm-dd

Changes needded:

  • [ ] use sDateFormatLong, sDateFormatNoYear and sDateFormatShort will customed format;
  • [ ] formats MM-DD-YYYY, DD-MM-YYYY and YYYY-MM-DD will use sDateFormatLong variable format;
  • [ ] formats 'd-m-Y' and 'Y-m-d' are converted according day, month and year order in sDateFormatLong variable;
  • [ ] create a function to convert formats as MM-DD-YYYY, DD-MM-YYYY and YYYY-MM-DD to 'm-d-Y', 'd-m-Y' and 'Y-m-d';

saulowulhynek avatar Nov 30 '16 15:11 saulowulhynek

  • [ ] Format MM-DD-YYYY Type JS Line 76 file src/skin/js/DepositSlipEditor.js
  • [x] Format MM-DD-YYYYType PHP Line 277 file src/CSVImport.php - don't change
  • [ ] Format DD-MM-YYYY Type JS Line 79 Gruntfile.js
  • [x] Format DD-MM-YYYYType PHP Line 278 file src/CSVImport.php - don't change
  • [ ] Format YYYY-MM-DDType PHP Line 543,544 file src/EventEditor.php
  • [ ] Format YYYY-MM-DDType PHP Line 213 file src/EventNames.php
  • [x] Format YYYY-MM-DDType PHP Line 276 file src/CSVImport.php - don't change
  • [ ] Format YYYY-MM-DDType PHP Line 988,1002 file src/PersonEditor.php
  • [ ] Format YYYY-MM-DD Type JS Line 50 file src/skin/js/Footer.js
  • [ ] Format YYYY-MM-DD Type JS Line 4 file src/skin/js/FindDepositSlip.js
  • [x] Format YYYY-MM-DD Type SQL Line 180 file src/mysql/install/Install.sql - don't change
  • [x] Format DD/MM Type SQL Line 181 file src/mysql/install/Install.sql- don't change
  • [ ] Format 'd-m-Y' Type PHP Line 171 file src/Reports/ClassList.php
  • [ ] Format 'Y-m-d' Type PHP Line 255, 351,746 file src/PersonView.php
  • [ ] Format 'Y-m-d' Type PHP Line 217 file src/Reports/PledgeSummary.php
  • [ ] Format 'Y-m-d' Type PHP Line 52 file src/Menu.php
  • [ ] Format 'Y-m-d' Type PHP Line 216 file src/sundayschool/SundaySchoolClassView.php
  • [x] Format 'Y-m-d' Type PHP Line 132 file src/Login.php don't change
  • [ ] Format 'Y-m-d' Type PHP Line 101, 311 file src/Reports/AdvancedDeposit.php
  • [ ] Format 'Y-m-d' Type PHP Line 521, 620 file src/USISTAddressVerification.php
  • [ ] Format 'Y-m-d' Type PHP Line 93 file src/Reports/TaxReport.php
  • [ ] Format 'Y-m-d' Type PHP Line 187 file src/FinancialReports.php
  • [ ] Format 'Y-m-d' Type PHP Line 331 file src/PrintView.php
  • [ ] Format 'Y-m-d' Type PHP Line 49 file src/SelectDelete.php
  • [ ] Format 'Y-m-d' Type PHP Line 137 file src/UserEditor.php
  • [ ] Format 'Y-m-d' Type PHP Line 406 file src/Include/Functions.php
  • [ ] Format 'Y-m-d' Type PHP Line 383 file src/FamilyView.php
  • [ ] Format 'Y-m-d' Type PHP Line 114, 213 file src/PledgeEditor.php
  • [ ] Format 'Y-m-d' Type PHP Line 32 file src/AutoPaymentEditor.php
  • [ ] Format 'Y-m-d' Type PHP Line 495 file src/PersonEditor.php
  • [ ] Format 'Y-m-d' Type PHP Line 58 a 63 file src/Reports/ClassAttendance.php
  • [ ] Format 'Y-m-d' Type PHP Line 46 e 48 file src/ChurchCRM/model/ChurchCRM/Note.php
  • [ ] Format 'Y-m-d' Type PHP Line 91 file src/Service/CalendarService.php
  • [ ] Format 'Y-m-d' Type PHP Line 105 e 127 file src/EventEditor.php
  • [ ] Format 'Y-m-d' Type PHP Line 50 e 139 file src/Service/DataSeedService.php
  • [ ] Format 'Y-m-d' Type PHP Line 50 file src/Service/TimelineService.php
  • [ ] Format 'Y-m-d' Type PHP Line 392 e 409 file src/CSVExport.php
  • [ ] Format 'Y-m-d' Type PHP Line 57 e 336 file src/Reports/CanvassReports.php
  • [ ] Format 'Y-m-d' Type PHP Line 163,170,173 file src/CSVCreateFile.php
  • [ ] Format 'Y-m-d' Type PHP Line 42 file src/Reports/ZeroGivers.php
  • [ ] Format 'Y-m-d' Type PHP Line 58,186 file src/EmailSend.php
  • [ ] Format 'Y-m-d' Type PHP Line 116 file src/ConvertOnePaymentXML.php
  • [ ] Format 'Y-m-d' Type PHP Line 20,21 file src/eGive.php
  • [ ] Format 'Y-m-d' Type PHP Line 156 e 202 file src/ChurchCRM/model/ChurchCRM/Deposit.php
  • [ ] Format 'Y-m-d' Type PHP Line 383,401 file src/Service/SystemService.php
  • [ ] Format 'Y-m-d' Type PHP Line 180 file src/ChurchCRM/Reports/PDF_Attendance.php
  • [ ] Format 'Y-m-d' Type PHP Line 204 file src/sundayschool/SundaySchoolDashboard.php
  • [ ] Format 'Y-m-d' Type PHP Line 80 file src/DepositSlipEditor.php
  • [ ] Format 'Y-m-d' Type PHP Line 134 file src/CanvassEditor.php
  • [ ] Format 'Y-m-d' Type PHP Line 136 file src/FundRaiserEditor.php

saulowulhynek avatar Nov 30 '16 20:11 saulowulhynek

ok, it isn't work

Many of references above are to put date and time in database and cannot be formatted with Date format. So i will resolve screen by screen.

In person View, I converted some dates for DateFormatLong .

datas_formatadas_hl

BUT, there are many uses of date in format "Nov 27, 1977", for example, as in picture above (red cicle). There isn't variable to control this date format and it not comon in many contries. Can I convert ALL system date for one of 3 formated date variable? (sDateFormatLong, sDateFormatNoYear and sDateFormatShort)

saulowulhynek avatar Nov 30 '16 23:11 saulowulhynek

I change my function do accept MMM and translate this to M in format()

saulowulhynek avatar Dec 02 '16 17:12 saulowulhynek

As asked by @DawoudIO , i should be in JS. I'm studying JS ...

saulowulhynek avatar Dec 08 '16 10:12 saulowulhynek

Is this still an issue?

crossan007 avatar Oct 09 '19 12:10 crossan007

This is an interesting idea, but for interoperability we need to settle on one day format for the back-end.

On the UI side it should be an option.

respencer avatar May 03 '24 16:05 respencer

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 17 '24 02:06 github-actions[bot]

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jul 31 '24 01:07 github-actions[bot]

This issue was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar Sep 05 '24 02:09 github-actions[bot]