jintervals icon indicating copy to clipboard operation
jintervals copied to clipboard

Make seconds argument optional - return formatting function

Open nene opened this issue 16 years ago • 0 comments

Currently it's like that:

jintervals(seconds, format);

I would like to make the seconds argument optional, so that calling jintervals with just a format string would give me a function that I could use over and over:

var format = jintervals("{Days}");

for (var i=0; i<data.length; i++) {
  alert( format(data[i]) );
}

But to really do that correctly, I have to switch the order of arguments:

jintervals(format, seconds);

Which means it will be backwards-incompatible change.

nene avatar Oct 27 '09 21:10 nene