Date Filter in Report Designer

enishemed
Posts: 648
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Date Filter in Report Designer

Post by enishemed »

It works thanks very much.
support wrote: 31 Jul 2022, 15:53 Try this

Code: Select all

FROM_UNIXTIME(e.field_826, '%Y-%m-%d') = '[filter_by_date]'
'[filter_by_date]' - with quotes.
User avatar
zeljkoK
Posts: 10
Joined: 16 Oct 2019, 10:37
Name: Zeljko Kacun
Location: Croatia - Nedelisce

Re: Date Filter in Report Designer

Post by zeljkoK »

Dear all,

I had a problem with a date filter where the date delimiter (-) was used as a math operator (The filter subtracted the month number from the year). :?

I solved it in the following way:
WHERE from_unixtime(e.field_1621, '%Y-%m') = "[filter_by_date]" (double quotes)

However, the problem remains that the datepicker control still does not pick up the defined language, but the expressions are only in English regardless of the selected language (Currently Croatian!).
datepicker.png
enishemed
Posts: 648
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Date Filter in Report Designer

Post by enishemed »

Yes, I have the same language problem.
zeljkoK wrote: 28 Oct 2022, 11:50 Dear all,

I had a problem with a date filter where the date delimiter (-) was used as a math operator (The filter subtracted the month number from the year). :?

I solved it in the following way:
WHERE from_unixtime(e.field_1621, '%Y-%m') = "[filter_by_date]" (double quotes)

However, the problem remains that the datepicker control still does not pick up the defined language, but the expressions are only in English regardless of the selected language (Currently Croatian!).

datepicker.png
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Date Filter in Report Designer

Post by support »

File from archive replace to plugins\ext\classes\report_page\
Now calendar picker should be in correct language.
Let me know if it works ok.
Attachments
report_filters.zip
(1.32 KiB) Downloaded 91 times
User avatar
zeljkoK
Posts: 10
Joined: 16 Oct 2019, 10:37
Name: Zeljko Kacun
Location: Croatia - Nedelisce

Re: Date Filter in Report Designer

Post by zeljkoK »

Dear Sergey,

excelent work. Calendar picker is now OK.
However, the output phrase ($output_value = (date('F Y', strtotime('[filter_by_date]')));) is still in English.
output.png
enishemed
Posts: 648
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: Date Filter in Report Designer

Post by enishemed »

I have this code to solve this problem. It is for Turkish.

Code: Select all

$date = '[filter_by_date]';
$date = explode("-", $date);

switch ($date[1]) {
  case "01":
    $month = "Ocak";
    break;
  case "02":
    $month = "Şubat";
    break;
  case "03":
    $month = "Mart";
    break;
  case "04":
    $month = "Nisan";
    break;
  case "05":
    $month = "Mayıs";
    break;
  case "06":
    $month = "Haziran";
    break;
  case "07":
    $month = "Temmuz";
    break;
  case "08":
    $month = "Ağustos";
    break;
  case "09":
    $month = "Eylül";
    break;
  case "10":
    $month = "Ekim";
    break;
  case "11":
    $month = "Kasım";
    break;
  case "12":
    $month = "Aralık";
    break;
}

$date = $month . " " . $date[0];
$output_value = $date;
zeljkoK wrote: 31 Oct 2022, 15:21 Dear Sergey,

excelent work. Calendar picker is now OK.
However, the output phrase ($output_value = (date('F Y', strtotime('[filter_by_date]')));) is still in English.
output.png
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Date Filter in Report Designer

Post by support »

Because date() this is default PHP function. App has own function i18n_date() that you can use (the same format as in date())
User avatar
support
Site Admin
Posts: 6215
Joined: 19 Oct 2014, 18:22
Name: Sergey Kharchishin
Location: Russia, Evpatoriya

Re: Date Filter in Report Designer

Post by support »

Example:

Code: Select all

$output_value = i18n_date('F Y',strtotime('[filter_by_date]'));
Post Reply