• Resolved hollosipeter

    (@hollosipeter)


    Hello!
    When somebody fills out in a forminator form the calendar and not fills from the date picker, manually can wrote this format: 2000.12.12 – from the date picker, this format is 2000-12-12. I have three problems with this, that forminator allow to use . instead of -.
    1.) I have a fitness access control system and I have all date in the users birthday – syncronizing from the wordpress and fitness database in YYYY-MM-DD format.
    2.) When somebody register on my site, it fills yith_birthdate field – because with YITH points and reward plugins they are getting points in their birthdays
    3.) I’m using wpdatatable plugin and it seems like if somebody using YYYY.MM.DD, the column’s content not shown on a frontend page with a wpdata-forminator shortcodes.

    When somebody doing this, I all time logging into wordpess database and in the forminator meta table manually updating date to YYYY-MM-DD

    Do you have (I didn’t find on github) a snippet for correcting this – or maybe planning to do an option what is using restrictions about this?
    Best idea: snippet/mu-plugin with autocorrecting the three dots to three lines between the date, or another one (not too user friendly) to show an error message that “date format should be in YYYY-MM-DD.”

    Thank you for your help!

    Regards,
    Peter

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @hollosipeter

    There is no way to input incorrect date in own format as setup from that field will show error message

    Not valid date

    Example: date is setup as YYYY/MM/DD. If as type DD/MM/YYYY I will see above error. This can be replicated on my lab site and on your site as well. Only difference is that you use dash instead of slash. But workflow is the same. Can you share with us more details, a video which you could share via google drive or dropbox so we could have a full light on this?

    Kind Regards,
    Kris

    Thread Starter hollosipeter

    (@hollosipeter)

    Hello Kris!

    Yesterday I got 2 email with .

    The common thing in both – both Android.
    Maybe can you check these?

    Thank you:
    Peter

    1.)

    Mozilla/5.0 (Linux; Android 13; SM-A528B Build/TP1A.220624.014; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.154 Mobile Safari/537.36 [FB_IAB/Orca-Android;FBAV/400.0.0.11.90;]

    2.)

    Mozilla/5.0 (Linux; Android 11; 2201116SG Build/RKQ1.211001.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.153 Mobile Safari/537.36 [FB_IAB/FB4A;FBAV/406.0.0.26.90;]

    Thread Starter hollosipeter

    (@hollosipeter)

    I got it! I can reproduct the error!

    CTRL+V / paste is allowing that without error (i tried from ios). So i think if somebody select autofill form, it gonna be happen.
    Try to copy YYYY.MM.DD – you can easily paste without an error message.

    Regards,
    Peter

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @hollosipeter

    Thank you for response!

    You are right – I just tested it and while I cannot just “enter” such date, I can easily paste it into the field and it goes through, no matter what is the form configuration.

    This would be a bug that we were not aware of yet and will need to be fixed directly in the plugin.

    I have already reported it to our developers so they could address it in future releases.

    As a “quick and dirty” temporary workaround, you could make the field to be “readonly”, forcing users to use the calendar – it wouldn’t let “freehand” typing and pasting.

    To achieve that, simply add this code to the site as MU plugin:

    <?php 
    
    add_filter( 'forminator_field_date_markup', 'forminator_date_readonly', 10, 2);
    function forminator_date_readonly( $html, $field ) {
    	
    	
    	if ( strstr( $field['element_id'], 'date' ) ) {
    		
    		$html = str_replace( '<input', '<input readonly ', $html );
    		
    		
    	}
    	
    	return $html;
    }

    – create an empty file with a .php extension (e.g. “forminator-datepicker-readonly.php”)
    – copy and paste code into it
    – save the file and upload it (e.g. using FTP) to the “/wp-content/mu-plugins” folder of your site’s WordPress installation.

    Kind regards,
    Adam

    Thread Starter hollosipeter

    (@hollosipeter)

    Thank you so much Adam, I tried it, perfect workaround! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Calendar format’ is closed to new replies.