EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
September 14, 2025, 04:46:09 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
EasyUI for jQuery
>
compare 2 dates with hh:mm:ss
Pages: [
1
]
« previous
next »
Print
Author
Topic: compare 2 dates with hh:mm:ss (Read 8060 times)
crosemffet
Jr. Member
Posts: 68
compare 2 dates with hh:mm:ss
«
on:
November 26, 2012, 11:56:43 AM »
I'm using: datetime box, format: yyyy-mm-dd hh:mm
the idea is compare 2 dates for report, starting date and ending date. obviously, ending date should be > than starting date.
I'm using the following parser function:
parser:function(s){
if (!s) return new Date();
var ss = s.split('-');
var y = parseInt(ss[0],10);
var m = parseInt(ss[1],10);
var d = parseInt(ss[2],10);
if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
return new Date(y,m-1,d);
} else {
return new Date();
}
}
it works perfect, except that it's not comparing the hh:mm part. only compares yyyy-mm-dd.
any modification will be very useful, I've been stucked in this point for hours...
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...