wpdm_all_packages: Proposal for handling order by dates for non-english dates

Viewing 1 post (of 1 total)
#115517

Lars Jørgen Tvedt
Participant

Standard norwegian date format is “d/m/Y”. Using this format the ordering of the table for wpdm_all_packages does not work. The reason is that the “data-order” attribute is not set correctly (is empty) because “strtotime” expects “english” date formatting.

A possible solutions would be to alter the code in “wpdm-all-downloads.php” at about line 240 from

<?php
  $tcols = $cols;
  array_shift($tcols);
  foreach ($cols as $colx ► $cold){
    $dor = array('publish_date' ► strtotime(get_the_date()), 'create_date' ► strtotime(get_the_date()), 'update_date' ► strtotime(get_the_modified_date('', get_the_ID())));
?>

to:

<?php
  $tcols = $cols;
  array_shift($tcols);
  foreach ($cols as $colx ► $cold){
    $dor = array('publish_date' ► get_the_date('Y-m-d H:i:s.u'), 'create_date' ► get_the_date('Y-m-d H:i:s.u'), 'update_date' ► get_the_modified_date('Y-m-d H:i:s.u', get_the_ID()));
?>

This should make it sortable regardless of selected date format in WP.

Viewing 1 post (of 1 total)

The topic ‘wpdm_all_packages: Proposal for handling order by dates for non-english dates’ is closed to new replies.