jQuery.countdown icon indicating copy to clipboard operation
jQuery.countdown copied to clipboard

if week is 0 hide it

Open mikyegy opened this issue 9 years ago • 1 comments

$('#clock').countdown(nextYear.toDate(), function(event) {


var $this = $(this).html(event.strftime(''

    + '%!w <div>  <span>%-w</span> <div>week</div>  <p>:</p>  </div> '

    + '%!d   <div>  <span>%-d</span> <div>days</div> <p>:</p>  </div>'

    + '  <div> <span>%H</span> <div>hours</div> <p>:</p>  </div>'

    + '  <div> <span>%M</span> <div>m</div> <p>:</p>  </div>'

    + ' <div>  <span>%S</span> <div>s </div> </div> '));


});

i try to hide week if %-w = 0 , how ?

mikyegy avatar Mar 21 '17 13:03 mikyegy

encuesta.find('.counterTime').countdown(fechaVigencia.text(), {elapse: true})
.on('update.countdown', function(event) {
	var weeks = event.offset.weeks;
	var days = event.offset.totalDays;

	if(weeks == 0)
		formatCounterTime = '%-d día%!D %H:%M:%S';
	if(weeks==0 && days==0)
		formatCounterTime = '%H:%M:%S';
	
	$(this).html(event.strftime(formatCounterTime));
});

Shinseiki86 avatar May 21 '17 17:05 Shinseiki86