Support

Account

Home Forums Backend Issues (wp-admin) Create dates on acf repeater rows possible ? Reply To: Create dates on acf repeater rows possible ?

  • I’ve answered this myself. I’ve used the hidden field addon plugin (https://github.com/erickertz/acf-hidden). If you set it to a width of 0.1% and don’t give it a title it appears very subtle within a repeater element and isn’t an eyesore.

    I’ve then used the append JS ACF hook to capture new repeater rows being added and I then populate this field with a unix datetime stamp!

    // catch newly created repeater rows... 
    acf.add_action('append', function( $el ){
    	var unixdatetime = Math.round((new Date()).getTime() / 1000);
    	var $row = $el.closest('.acf-row');       
    	$row.find('.acf-field-5ad749e45b14f input').val(unixdatetime);
    	console.log("set date time stamp: "+unixdatetime);
    });