使用方法:
$.payment.validateCardExpiry('xx','xx');
var object = {'month':'xx','year':'xx'};
$.payment.validateCardExpiry(object);
#coffee code
$.payment.validateCardExpiry = (month, year) ->
# Allow passing an object
if typeof month is 'object' and 'month' of month
{month, year} = month
#js code
$.payment.validateCardExpiry = function(month, year) {
var currentTime, expiry, _ref;
if (typeof month === 'object' && 'month' in month) {
_ref = month, month = _ref.month, year = _ref.year;
}
沒有留言:
張貼留言