Forum Replies Created
-
AuthorPosts
-
toni bird
ParticipantHi Long, last doubt/question on this matter.
If I have the following scenario :
Group date with a date field that populates the date_to_text field ( just like you told me ) works well within the group. but when I clone this group does not work anymore because all fields get a new name ( i.e. start_date_hlksjdhfk) any way to make the cloned groups to work independently within the group itself? Many thanks
<?php add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' ); function your_prefix_register_meta_boxes( $meta_boxes ) { $prefix = ''; $meta_boxes[] = [ 'title' => esc_html__( 'testing', 'text-domain' ), 'id' => 'testing', 'post_types' => ['post'], 'context' => 'normal', 'priority' => 'high', 'fields' => [ [ 'id' => $prefix . 'group_date', 'type' => 'group', 'name' => esc_html__( 'Group Date', 'text-domain' ), 'fields' => [ [ 'id' => $prefix . 'start_date', 'type' => 'date', 'name' => esc_html__( 'Start_date', 'text-domain' ), ], [ 'id' => $prefix . 'date_to_text', 'type' => 'text', 'name' => esc_html__( 'Date to text', 'text-domain' ), 'class' => 'date_to_text', ], ], 'clone' => 1, 'default_state' => 'expanded', 'clone_default' => 1, ], ], ]; return $meta_boxes; }toni bird
ParticipantHi Long,
Great, many thanks
toni bird
ParticipantHi Long,
Does it also work with cloned groups?
thanks
toni bird
ParticipantHi Long,
many thanks, works beautifully...
regards
toni bird
ParticipantHi Long,
Many thanks for you help, can't wait to get de conditional date based on another date field working..... please let us know when is out...
I've managed to get the javaScript working but only when the "date_to_text" field is outside a group , any chance to work inside groups? Start date is out and date_to_text is inside a group...
thanks again
toni bird
ParticipantHi Long, thanks for your help. will give it a try
toni bird
ParticipantHi Long, thanks a lot, got it sorted.
cheers
toni bird
ParticipantHi again Long,
Sorry for being a pain, but I don't know how to call the filter in views. I have added the code into my theme's functions.php file, but not sure how to call the function in views .
I've tried{% set value = mb.rwmb_soma_staff_d_value %}but nothing happens. is this correct?thanks
toni bird
ParticipantHi Long,
Thanks again for your prompt reply, works like magic.
cheers
toni bird
Participantsorry, my array actually come out like this:
Array ( [0] => Array ( [equip] => Trator [equip_qtd] => 1 [_state] => collapsed ) [1] => Array ( [equip] => Retro-escavadeira [equip_qtd] => 3 [_state] => collapsed ) [2] => Array ( [equip] => Trator [equip_qtd] => 6 [_state] => collapsed ) )
toni bird
ParticipantHi Long, thanks for your help again.
cheers
toni bird
ParticipantHi, not sure if I should open another topic, but it is still on the same matter.... I have a report system that my client creates a report on daily basis. client fills a custom fields form and when he publishes a post on views he gets a report page with a sum from values added to the fields. next day he duplicates the post ( post duplicator plugin) and just change the date and add new values to the fields.. My question is. how do I store the sum of values from yesterday's post (previous post) and sum with the new values from today's post ? and so on .... is it possible in views to do that? any work around?
many thanks
toni bird
ParticipantHi, Got it sorted, code
{% set contract = date(post.site_finish | date( 'Y/m/d') ).diff(date(post.site_start | date( 'Y/m/d' ))) %} {% set contractDays = contract.days %} {% if contractDays == 1 %} 1 day {% else %} {{ contractDays }} days {% endif %}cheers
toni bird
ParticipantHi, many thanks,
{% set difference = date(post.site_start|date('d/m/Y')).diff(date(post.site_finish|date('d/m/Y'))) %} {% set leftDays = difference.days %} {{leftDays}}Not sure what is wrong.... but is not working....
got the add and multiplier functions working, but the dates are not working.... I just get a "0" as result.
thanks
toni bird
ParticipantHi Long, thanks for your reply,
I need to get number of days between 2 dates ( start and finish ) both values come from mb fields.
I also need to add a couple of + and - operations based on other field values from this form.many thanks
-
AuthorPosts