• Resolved imachine

    (@imachine)


    I have a strange issue with the calculated number of days.

    Today it’s October 5, 2019 and I use the following shortcode:
    echo do_shortcode('[tminus t="2019-10-27 23:59:59" /]')

    Page source shows me the following, which seems correct:

    
    targetDate: {
    	'day': 	28,
    	'month': 10,
    	'year': 2019,
    	'hour': 00,
    	'min': 	59,
    	'sec': 	59,
    	'localtime': '10/5/2019 11:18:15'
    },
    

    This should be some 22 days form now, but the counter is showing
    “01” day.

    If I change the date to for example:
    tminus t="2019-10-10 23:59:59"
    the counter shows 05 days, which is correct

    If I change the date to for example:
    tminus t="2019-10-20 23:59:59"
    the counter shows 01 days, which is incorrect

    I’ve also tried the following:
    tminus t="10/27/2019 23:59:59"
    tminus t="October 27, 2019"

    I deactivated the Autoptimize caching plugin, it made no difference.

    Can you please help me try to understand what’s going on?
    Any help would be really appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter imachine

    (@imachine)

    Figured it out.
    I did the hiding of years and months with css, as i did not know there are omityears and omitmonths attributes. The documentation only mentions the omitweeks attribute.

    It appears you can use this for omitting years and monts as well.

    So for example, this will omit years, months and weeks in the counter:
    [tminus t="2019-10-27 23:59:59" omityears="true" omitmonths="true" omitweeks="true"]

    Plugin Author twinpictures

    (@twinpictures)

    Yeah, sorry, we have new documentation that will be released soon on this issue. But good on you for figuring it out!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can not get daycount right’ is closed to new replies.