Search code examples
jquerydatetimecountdown

Countdown by difference between two date in xdan/flipcountdown jquery plugin


I am using xdan-flipcountdown jquery plugin as a counter. I have two date variables:

start_date=1396-10-04
end_date=1396-10-08

I want to calculate the difference between two date variables and count down it's value I use method like this:

$(".timer").flipcountdown({
        size:'sm',
        beforeDateTime: end_date
});

but it is not worked? how can I Calculate the difference and then count down it's difference?


Solution

  • i solved this.i use JDateTime php class then convert shamsi date to Gregorian date.then use:

                $(this).flipcountdown({
                    size:'sm',
                    beforeDateTime: $(this).attr('data-time-end')
                });