How to retrieve a date attribute in an email

Hi,

<script type="text/javascript">
    require(['jquery', 'mage/calendar'], function($){
	    $("#input_date").calendar({
	        buttonText: "<?php echo __('Date') ?>",
  	        dateFormat: "d/m/yy",
	        minDate : 0
	    });
    });
</script>

Or you can change date format from PHP using the following code. Reference

$created_at = \DateTime::createFromFormat('j/n/Y', $created_at)->format("l");

Kind regards,

Thomas

2 Likes