Looking for the latest version? Download sumdate.zip (82.2 kB)
Home
Name Modified Size Downloads / Week Status
Totals: 10 Items   16.2 kB 6
v1.2.2 2015-09-28 11 weekly downloads
v1.2.1 2013-06-01 22 weekly downloads
v1.2.0 2013-05-22 22 weekly downloads
v1.1.0 2013-04-10 22 weekly downloads
v1.0.0 2013-04-05 55 weekly downloads
readme.md 2013-05-22 2.9 kB 22 weekly downloads
jquery.sumdate-0.4.0.js 2013-03-19 6.3 kB 11 weekly downloads
jquery.sumdate-0.3.0.js 2013-03-06 3.9 kB 11 weekly downloads
jquery.sumdate-0.2b.js 2013-02-28 2.5 kB 11 weekly downloads
jquery.sumdate.min-0.1b.js 2013-01-05 540 Bytes 11 weekly downloads

sumdate

Jquery plugin used to sum and validate dates

Sintax

Directly invoke String/Date $.sumdate(date:String/Date,functions:[],sumValues:{},pattern:String,update:boolean); or Selector invoke void/Array $(selector).sumdate(functions:[],sumValues:{},pattern:String,update:boolean);

Params

selector or date

selector: jQuery return elements html that contains date value.
date: date value String or Date.

anotherDate: date value String or Date (only used with in function between).

sumValues: { days: 0, months: 0, years: 0, "hours": 0, "minutes": 0, "seconds": 0, "hours": 0, "minutes": 0, "seconds": 0, } internationalisation: { "language": language, display: false, divErrorId: undefined, jsonError: true }

pattern: define format date writing

update: update the elements that contains the date with the result (only directly selector).<br />

functions

sum: get values in sumValues and sum parameter date. stringToDate: convert a date type String in Date type. dateToString: converte a date Type Date in String. validate: return true if the date value is valid or return false not valid (only date a type String) not compatible another functions. between: return sumVelues (json), get a difference between parameters anotherDate and date/selector.

Ex:

sum

var data = '02/12/1982';
data = $.sumdate({functions:['sum'],sumValues:{days:1,months:1},date: data});
alert(data); // 03/01/1983 return String type.

stringToDate

var data = '02/12/1982';
data = $.sumdate({functions:['stringToDate'],date: data});
alert(data); // Thu Dec 02 1982 00:00:00 GMT-0200 return Date type.

dateToString

var data =  new Date('1982-12-02T00:00:00.0');
data = $.sumdate({functions:['dateToString'],date: data});
alert(data); // 02/12/1982 return type String

validate

var valid= $.sumdate({ date: '28/02/2010', functions: ['validate'] });
alert(valid); // true;
valid = $.sumdate({ date: '29/02/2010', functions: ['validate']});
alert(valid); // false;

between

var sumValues = $.sumdate({ date: '28/02/2010', functions: ['between'], anotherDate: '02/04/2012' });
/* 
    The return is json type:
    sumValues = {
        "years": 2,
        "months": 1,
        "days": 3, -> 2012 is bissextile!
        "hours": 0,
        "minutes": 0,
        "seconds": 0
    };
*/

sum (error)

--html
    <div id='error'></div>
    <input id="Date" value="32/12/2013">
--script
    $('#Date').sumdate({ functions: ['sum'], sumValues: { days: 1 }, internationalisation:{display:true,divErrorId:'error'} })
Source: readme.md, updated 2013-05-22

Thanks for helping keep SourceForge clean.

Screenshot instructions:
Windows
Mac
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies
X

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks