如何比较arraylist中的对象并从中获取最低时间 [英] How to Compare object in arraylist and get lowest time from it
本文介绍了如何比较arraylist中的对象并从中获取最低时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有如何比较对象checkintime并从arraylist获得最低时间
Dear All how to compare object checkintime and get lowest time from arraylist
var tbl_A=[{
'eid': 1,
'checkintime': '10:05:00',
'checkouttime': '02:05:00',
'Day':'Sunday',
'Date': '27-04-2014'
},
{
'eid': 2,
'checkintime': '02:30:00',
'checkouttime': '04:25:00',
'Day':'Friday',
'Date': '25-04-2014'
},
{
'eid': 3,
'checkintime': '04:30:00',
'checkouttime': '06:34:00',
'Day':'Thusday',
'Date': '24-04-2014'
},
{
'eid':1,
'checkintime': '09:58:00',
'checkouttime': '02:15:00',
'Day':'Sunday',
'Date': '27-04-2014'
},
{
'eid':2,
'checkintime': '02:45:00',
'checkouttime': '04:40:00',
'Day':'Friday',
'Date': '25-04-2014'
},
{
'eid':3,
'checkintime': '05:02:00',
'checkouttime': '06:15:00',
'Day':'Thusday',
'Date': '24-04-2014'
},
{
'eid':1,
'checkintime': '09:45:00',
'checkouttime': '02:00:00',
'Day':'Sunday',
'Date': '27-04-2014'
},
{
'eid':2,
'checkintime': '02:15:00',
'checkouttime': '04:40:00',
'Day':'Friday',
'Date': '25-04-2014'
},
{
'eid':3,
'checkintime': '04:55:00',
'checkouttime': '06:01:00',
'Day':'Thusday',
'Date': '24-04-2014'
}
];
以上是我的arraylist我想根据eid和想要比较我的checkintime低时间请告诉我代码
above is my arraylist i want to compare my checkintime as per eid and want low time pls let me know with code
推荐答案
你好,
类似的问题已被问到。请查看如何使用Javascript比较两个日期或Jquery [ ^ ]
FYI:如果您的原始代码是正确的,请更正今日。
在你的日期做一个for / while循环并检查如何比较它。这不应该给你带来任何麻烦。在最坏的情况下,浪费一些时间:P
此外,codeproject已经有大量的文章/提示和问题/答案与示例,请在发布问题之前检查。通常你会发现你的答案要快于某人的答案。
问候,
Hello,
A similar question has already been asked. Please check How to compare two dates using Javascript or Jquery[^]
FYI: Please correct "Thusday" if that is on your original code.
Do a for/while loop on your dates and check on how to compare it. This shouldn't cause you any trouble. At worst, some time will be wasted :P
Also, codeproject already has a vast library of articles/tips and questions/answer with examples, please check before posting a question. Usually you will find your answer much faster than wainting for someone to answer.
regards,
这篇关于如何比较arraylist中的对象并从中获取最低时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文