• Opening a new ticket as requested with a feature request…

    I’d like to add the Year, Month, Date for the purpose of calculation, but only display the Year.

    For example, if the business started on Nov 15, 2020, I’d like to say that it’s been around “3 years” up until Nov 15, 2024, when it switches to “4 years”.

    However if I put: [years-since y=2020 m=11 d=15] it displays as “3 years, 5 months, 2 days” — whereas I’d like it to just say “3 years”.

    This would allow me to create verbiage on client websites like, “Been in business for 7 years” and have it auto-update when they hit their business anniversaries.

    Thanks for the great plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author laurencebahiirwa

    (@laurencebahiirwa)

    This is a good improvement. I will add this to the do for the next release.

    Plugin Author laurencebahiirwa

    (@laurencebahiirwa)

    @pauldrecksler I am looking for context here. I have been working on something like this:

    [y=2000 m=1 d=1 show=’y’] will output 24 years only skipping the month and day.
    [y=2000 m=1 d=1 show=’ym’] will output 24 years 1 month only skipping the day.

    However, I am rethinking this not to bloat up the code. Is there a reason why using [y=2000] which calculates the year only giving you 24 years does not work for your case? Do you really need to have the whole [years-since y=2020 m=11 d=15] added to your content?

    Appreciate your feedback.

    Thread Starter pauldrecksler

    (@pauldrecksler)

    If there’s not enough demand for this feature, I certainly don’t want to bloat up your code.

    My request just comes down to accuracy. Like if a business started on Dec 15, 2022 for example, as soon as Jan 1, 2024 came along, the plugin in its current form would display “2 years”, which isn’t that accurate given that the business had only been in business for 1 year and 16 days at that point.

    For my particular use case, I would add the whole date for the purpose of calculation, and then simply display the year only. I personally wouldn’t get use out of hiding just the day and showing the year / month. However I think your solution would work for either case.

    Like I said though, I appreciate you even considering it and brainstorming out some solutions. No hard feelings if it bloats up your code too much and you decide not to move forward with it.

    philmatthews

    (@philmatthews)

    I’d love this feature too. Did the plugin used to only output the year even if I added a shortcode like [years-since y=2004 m=5 d=14] – I use it as a feature to show how long I’ve been in business and it used to output “19 years” but now includes the date and month too which I’d love to be able hide if possible in the future? Thanks for your work with this great plugin! 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feature Request: Add Year, Date, Month for calculation, but only show year’ is closed to new replies.