PHP HTML中的日期排序出错 [英] Date sorting goes wrong in PHP HTML

查看:77
本文介绍了PHP HTML中的日期排序出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个包含10列的数据表,第9列是按降序排序的日期。这按预期排序。对于某种情况,该值应提供超链接。当我提供超链接时,它会错误地排序。

Hi all,
I have a datatable with 10 columns and the 9th column is date which is to be sorted in descending order. This gets sorted as expected. For a certain condition, the value should be provided with hyperlink. When i provide hyperlink, then it is sorting wrongly.

<td class="tablecntcolum"><a href='.$logFilePath.'target="_new">'.$field_monitor_values[$i[10].'</a></td>





最后的输出是这样的:

30-Apr-17

30-Apr-17

15-Sep-16

15-Sep-16

15-Sep-16

15-Sep-16

15-Sep-16 br />
15-Oct-16

05-May-17

05-May-17 < br $> b $ b

我的尝试:





Thenfinal output is something like this :
30-Apr-17
30-Apr-17
15-Sep-16
15-Sep-16
15-Sep-16
15-Sep-16
15-Sep-16
15-Oct-16
05-May-17
05-May-17

What I have tried:

var poltable = $('#pol_table').DataTable( {
       order: [[ 9, 'desc' ]],//sorting based on 9th column
       pageLength: 50,
       autoWidth: true
   });

推荐答案

logFilePath.'target =_ new>'。
logFilePath.'target="_new">'.


field_monitor_values
field_monitor_values


i [10]。'< / a>< / td>
i[10].'</a></td>





Thenfinal输出是这样的:

30-Apr-17

30-Apr-17

15-Sep-16 br />
15-Sep-16

15-Sep-16

15-Sep-16

15-Sep-16

15-Oct-16

05-May-17

05-May- 17



我尝试过的事情:





Thenfinal output is something like this :
30-Apr-17
30-Apr-17
15-Sep-16
15-Sep-16
15-Sep-16
15-Sep-16
15-Sep-16
15-Oct-16
05-May-17
05-May-17

What I have tried:

var poltable =


这篇关于PHP HTML中的日期排序出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆