• Resolved anthonyflibustiers

    (@anthonyflibustiers)


    Heelo guys, hope you doing great !

    I’ve linked a form to google calendar unsing uncanny automator. I works great with the date and the start time of the event but I haven’t find out how to add a end time. I’ve set a calculation that add +1 hour to the start time, so my event will be one hour long : ({select-2}+1) For example 10+1=11. I have to set to this to the “11:00” format so I’ve used a html field. It looks fine on the front but it is not recognize by the calendar, I supposed it has something to with the fact that the raw data contain the <p>.

    Can you help me with that ?

    Thanks !

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @anthonyflibustiers

    I hope you’re well today!

    A simple workaround for it may be as follows:

    1. keep the HTML field as you have it but then

    2. in “calculation” field settings

    – make sure that the “Round To” option is set to “0 decimals”
    – and add suffix like this

    :00

    to the “Suffix” setting there.

    On front-end (on the form) HTML field will take care of the nice display just like it does now and in submission/e-mail notification that :00 will be automatically added to calculation result.

    I believe is should be picked-up by Uncanny Automator too then.

    The “catch” here is that there will be additional space/blank between actual hour and that :00 suffix so instead of e.g.

    11:00

    it will be

    11 :00

    I’m not sure if that can be addressed by the Uncanny Automator maybe it has some option to strip such blanks from received data?

    If it doesn’t and/or this workaround isn’t sufficient, let us know and we’ll ask our developers if they could provide some code snippet to provide such formatting instead.

    Best regards,
    Adam

    Thread Starter anthonyflibustiers

    (@anthonyflibustiers)

    Hey !

    I’ve try as explain but now I get “11 11 :00”. So the space is indeed there but there’s also calculated result that appears twice, for a reason I don’t get.

    Any idea ?

    I’ve reached the Uncanny support about the blank.

    Thanks !

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @anthonyflibustiers,

    I hope you’re doing great today!

    Could you please export the form, and share the exported file with us via Google Drive, Dropbox, Pastebin.com, or a similar cloud service.

    In case you’d like to remove any sensitive data before sharing the form, just duplicate, and remove it before exporting.

    Looking forward to your reply.

    Best Regards,
    Dmytro

    Thread Starter anthonyflibustiers

    (@anthonyflibustiers)

    Hello !

    Here you go : https://pastebin.com/vkeVv85K

    Thanks !

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @anthonyflibustiers

    I pinged our SLS Team to review your case and see if we can help in that matter. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @anthonyflibustiers

    Please try this code as a mu-plugin:

    add_filter( 'forminator_custom_form_submit_field_data', 'wpmudev_fix_calculation_prefix', 10, 2 );
    function wpmudev_fix_calculation_prefix( $field_data_array, $module_id ) {
    	if ( 45481 !== intval( $module_id ) ) {
    		return $field_data_array;
    	}
    
    	foreach ( $field_data_array as $key => $value ) {
    		if ( 'calculation-1' === $value['name'] ) {
    			$field_data_array[ $key ]['value'] = str_replace( ' :', ':', $value['value'] );
    		}
    	}
    
    	return $field_data_array;
    }

    This snippet should fix the space issue in the calculation field. Please change?45481?to your form’s ID before testing.

    You can follow our docs here for more detailed steps on how to install a?mu-plugin.
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Kind Regards,
    Kris

    Thread Starter anthonyflibustiers

    (@anthonyflibustiers)

    Hi there !

    Thanks for your answer, unfortunatly it doesn’t works for me. As the mu-plugin is installed I hace the following line appears on top of my site : $value ) { if ( ‘calculation-1’ === $value[‘name’] ) { $field_data_array[ $key ][‘value’] = str_replace( ‘ :’, ‘:’, $value[‘value’] ); } } return $field_data_array; } and the form does not work at all. I’ve tried to use it as a snippet (with “code snippet” plugin) but it return me this: Unclosed ‘(‘ on line 8 does not match ‘}’.

    Thanks !

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @anthonyflibustiers,

    I hope you are doing well today!

    Thanks for your answer, unfortunatly it doesn’t works for me. As the mu-plugin is installed I hace the following line appears on top of my site

    As I checked the code, there are no syntax errors. Please make sure to add <?php as the first line when using the code snippet as mu-plugin and change?45481?to your form’s ID in the code.

    You can find more information below on how to use mu-plugins.
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
    and
    https://www.ads-software.com/support/article/must-use-plugins/

    It would be better to test this out on your staging/dev environment first before your live site and make sure you have the latest backups.

    Kind regards,
    Zafer

    Plugin Support Dmytro – WPMU DEV Support

    (@wpmudevsupport16)

    Hello @anthonyflibustiers,

    I hope you’re doing good today!

    As we haven’t heard from you for some time now, I’ll be marking this thread as resolved. Please feel free to reply if you still have any questions.

    Best Regards,
    Dmytro

    Thread Starter anthonyflibustiers

    (@anthonyflibustiers)

    Hi there !


    Sorry for the delay. I’ve managed to use your code (somehow the copy-paste changed the caracters..) and it seems to work as I don’t have any blanks in the time but I still have another digit in front of it so the time is not recognized :

    I don’t know where it comes from, can you help ?

    Thanks !

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @anthonyflibustiers

    Please email us at: [email protected]
    Subject: ATTN: WPMU DEV support – wp.org

    Please send:
    – Link back to this thread for reference (https://www.ads-software.com/support/topic/html-field-formated/)
    so that we can review this case more for you and see what will be possible in this case.

    Kind Regards,
    Kris

    Thread Starter anthonyflibustiers

    (@anthonyflibustiers)

    Hi there !

    I didn’t had any response from your support ??

    Anyway, I’ve managed to create events by using the hour field for start and end time, and it works fine for me.

    So, almost resolved !

    Thanks

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @anthonyflibustiers,

    Sorry, we didn’t receive any email from your end. However, we are glad to know you managed to resolve this. Please feel free to reach out if you need any further assistance. We are happy to help.

    Kind Regards,
    Nebu John

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.