Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Date comparison methods lessDate and greaterDate #11

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
jlinq-beta
==========

Total rewrite of jLinq - Public beta code

25 changes: 24 additions & 1 deletion jlinq.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/*
* jlinq-node 0.0.1
* Nik Martin - nikmartin.com
* based on:
* jLinq - 3.0.1
* Hugo Bonacci - hugoware.com
* http://creativecommons.org/licenses/by/3.0/
Expand Down Expand Up @@ -977,7 +980,17 @@ var jl;
other:function() { return this.value > value; }
});
}},


//is the date value greaterDate than the argument
{ name:"greaterDate", type:framework.command.query,
method:function(value) {
return this.compare({
array:function() { return this.value.length > value; },
string:function() { return new Date(this.value) > new Date(value); },
other:function() { return new Date(this.value) > new Date(value); }
});
}},

//is the value greater than or equal to the argument
{ name:"greaterEquals", type:framework.command.query,
method:function(value) {
Expand All @@ -988,6 +1001,16 @@ var jl;
});
}},

//is the date value lessDate than the argument
{ name:"lessDate", type:framework.command.query,
method:function(value) {
return this.compare({
array:function() { return this.value.length < value; },
string:function() { return new Date(this.value) < new Date(value); },
other:function() { return new Date(this.value) < new Date(value); }
});
}},

//is the value less than the argument
{ name:"less", type:framework.command.query,
method:function(value) {
Expand Down