countdownDuration = function countdownDuration(due) {
	var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};


	if (typeof due === 'undefined') {
		throw 'Can\'t start counter, the "due" parameter is required';
	}

	// set base options
	options = mergeObjects(DEFAULT_COUNTDOWN_OPTIONS, options);

	// set private target
	var target = isDate(due) ? due : dateFromISO(due);

	// counter api
	var counter = createCounter({
		due: clone$1(target),
		onended: function onended() {}
	});

	// get offset
	getServerOffset(options.server, function (offset) {

		counter.offset = offset;

		var count = function count() {

			var now$$1 = offsetDate(offset);

			// test if reached target date
			if (target - now$$1 <= 0) {

				// set final value
				counter.value = new Array(options.format.length).fill(0);

				// set output to zero
				counter.onupdate(counter.value);

				// stop timer
				counter.timer.stop();

				// we're done!
				counter.onended();

				// really done!
				return;
			}

			// set value
			counter.value = dateDiff(now$$1, target, options.format, options.cascade);

			// calculate duration
			counter.onupdate(counter.value);
		};

		// start our counter
		counter.timer = setTimer(count, options.interval, { autostart: false });

		// ready!
		counter.complete = true;
		counter.onload();

		// run timer
		counter.timer.start();
	});

	return counter;
}
Count down towards date
@param due
@param options
@returns object