*

Vettalo

  • ***
  • 59 posts
bet_smart_date for item expire date by days
« on: February 14, 2022, 07:51:31 PM »
i want to display days left for item expiration date in user-items.php
<span><?php echo (date('Y', strtotime(osc_item_field('dt_expiration'))) > 3000 ? __('Never expire', 'beta') : __('Expire on', 'beta') . ' ' . date('Y/m/d', strtotime(osc_item_field('dt_expiration')))); ?></span>
any one can help to make this work?
« Last Edit: February 14, 2022, 08:00:56 PM by Vettalo »

*

MB Themes

Re: bet_smart_date for item expire date by days
« Reply #1 on: February 18, 2022, 02:46:35 PM »
This could work:
Code: [Select]
<span><?php echo (date('Y'strtotime(osc_item_field('dt_expiration'))) > 3000 __('Never expire''beta') : __('Expire in''beta') . ' ' bet_smart_date(osc_item_field('dt_expiration')); ?></span>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Vettalo

  • ***
  • 59 posts
Re: bet_smart_date for item expire date by days
« Reply #2 on: February 18, 2022, 07:08:15 PM »
This could work:
Code: [Select]
<span><?php echo (date('Y'strtotime(osc_item_field('dt_expiration'))) > 3000 __('Never expire''beta') : __('Expire in''beta') . ' ' bet_smart_date(osc_item_field('dt_expiration')); ?></span>

its working but i want to display only days left for example if listing will expire in 2 months it will display Expire in: 60 days
thank you for your support.