• Back with another issue ??

    I have an ACF Time field which I’m trying to get to display in 12hr format. Field is set to use format “g:i A”, but I can’t get shortcode to play ball. It’s always displaying time using a 24hr format. Also seems to be the case with Date Time field, I can’t format the output with CCS. Using other methods the format is correct, but not with CCS. I’ve checked the site settings and they are set to use 12hr clock as well.

    I’ve tried things like [field acf_date=time_start format='g:i A'] and [field time_start format='g:i A'] for example. Tried without format. For what it’s worth the example [today format='Y-m-d H:i'] works fine and I can format it the way I want.

    Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Try

    [field time_start date_format='g:i A']

    • This reply was modified 3 years, 8 months ago by polarracing.
    Thread Starter finnfin

    (@finnfin)

    Thanks, again! How do you find all these? ??

    A lot of experience with this plugin. Using it to sketch complex projects. ??

    Thread Starter finnfin

    (@finnfin)

    Nice, yeah tend to pick up things when you tinker ??

    Let’s see if this will stump you:)

    I would need to sort an ACF Related list by an ACF field in the related posts, preferably by two things. First by weekday, then by time.

    [related event orderby=?? order=ASC count=8]
    [taxonomy weekday]
    [field time]
    [/related]

    This might not even be possible from what I understand?

    Not sure about related fields – I use taxonomies for relations.

    I would store the relation as id, then read out the field and get an id-list. This can then be used to limit a loop – and a loop can be sorted.

    • This reply was modified 3 years, 8 months ago by polarracing.
    Thread Starter finnfin

    (@finnfin)

    Thanks for that. Not sure I understood yet, but I’ll try and wrap my head around what you suggested ??

    [related event]
    [if var=my_list]
    [set my_list][get my_list],[field id][/set]
    [else]
    [set my_list][field id][/set]
    [/if]
    [/related]
    [pass vars]
    [loop type=my_content id={MY_LIST} orderby=name order=ASC]
    Do what you need
    [/loop]
    [/pass]
    • This reply was modified 3 years, 8 months ago by polarracing.
    Thread Starter finnfin

    (@finnfin)

    Great! That works perfect.

    I’m passing another field to use as a filter with an [if] statement, and it seems using [count=5] limits how many time the loops runs through. Is there a way to limit the actual output count after filtering, not the loop count?

    Also, would this same sorting method work for repeater rows?

    • This reply was modified 3 years, 8 months ago by finnfin.
    Thread Starter finnfin

    (@finnfin)

    Any ideas on this? I can’t figure out how to loop through repeater rows and then sort them.

    Another issue that I have is that inside the said repeater is a taxonomy field, which is actually taxonomy of another post type. Is there any way I can call that field with shortcode and have it output the taxonomy name, not ID? It works fine if I set the field to return ID, but if I use Term Object, it breaks it completely and i get error “ERROR: WP_Term could not be converted to string”. Is there a way to use say format method to output the actual taxonomy name?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘ACF Time field’ is closed to new replies.