• Resolved swcomm

    (@swcomm)


    Date is an ACF custom field stored as Y-m-d. Want to display in feed as m-d-Y or similar if possible. Possible? thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    Hi @swcomm,

    Not sure if this is possible now, but I could probably add it to the plugin.

    As I understand you are getting your field with something like:

    
    [alg_product_meta name="your_custom_field_name"]
    

    And the only problem is that date format is not as you need, so this could be solved for example by:

    
    [alg_product_meta name="your_custom_field_name" convert_date_format="m-d-Y"]
    

    Please let me know if that is correct and I will add convert_date_format attribute to the shortcode.

    • This reply was modified 5 years, 10 months ago by Algoritmika.
    Thread Starter swcomm

    (@swcomm)

    Thanks for the reply. Yes, the shortcode retrieves the custom field date correctly, but I need to change its formatting, so sounds like your solution would do it.

    But there’s no rush – I ended up creating a custom RSS feed for products that take care of the issue for my immediate need. But having that date formatting capability in your plugin would be nice to use for other feeds. We use WooCommerce for events, so event date is an important part of the feed.

    Thank you!

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @swcomm,

    Ok, got it. We’ve just released new plugin version 1.4.5, where I’ve added a couple of new shortcodes including [alg_format_date]. I went a different way than I was going to and added a more generalized solution, so this is what you need to add to your feed template:

    
    [alg_format_date format="m-d-Y"][alg_product_meta name="your_custom_field_name"][/alg_format_date]
    

    This way you will be able to format date outputted from any shortcode, not only [alg_product_meta].

    Please let me know if something is not working as expected or if you have any questions. And if you like the plugin, please consider leaving us a rating.

    Thread Starter swcomm

    (@swcomm)

    Hi again – sorry for the delay, had to switch to another project. Yes, that shortcode works perfectly. Nice that I can use any date formatting as well. Great work, thanks much.

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @swcomm,

    Sure, no problem, happy to help ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Formatting a Custom Date Field in Feed’ is closed to new replies.