• Resolved mjunes

    (@mjunes)


    Hello,

    I would like to know if it is possible to replace the colon (:) symbol between the hour and minute field with “at”?

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mjunes,

    In this case you need to run your own code to replace the signs, for example, insert a “HTML Content” field in the form with the following piece of code:

    
    <script>
    fbuilderjQuery(document).one(function(){
    jQuery('.cff-date-field .dfield').contents().filter(function() {
        return this.nodeType == 3
    }).each(function(){
        this.textContent = this.textContent.replace(':',' at ');
    });
    })();
    </script>
    

    I’m sorry, but if you need more specialized support, you should contact me through my private website:

    https://cff.dwbooster.com/contact-us

    Best regards.

    Thread Starter mjunes

    (@mjunes)

    Hello,

    I think something is wrong with the script because it breaks my form. Can you please check?

    Thanks much

    Plugin Author codepeople

    (@codepeople)

    Hello @mjunes,

    Yes, totally my fault, the correct code would be:

    
    <script>
    fbuilderjQuery(document).one('showHideDepEvent', function () {
    	fbuilderjQuery('.cff-date-field .dfield').contents().filter(function () {
    		return this.nodeType == 3
    	}).each(function () {
    		this.textContent = this.textContent.replace(':', ' at ');
    	});
    });
    </script>
    

    Best regards.

    Thread Starter mjunes

    (@mjunes)

    Thank you. Worked like a charm.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Replace the “:” symbol with “at” in datetime field’ is closed to new replies.