datefield with current value date
Set a datefield with the value of the current system date using phtml
<div class="row">
<div class="large-2 columns">
<label for="fieldContFecnaci">FECHA DE NACIMIENTO</label>
</div>
<div class="large-4 columns">
<?php
echo $this->tag->dateField(array("CONT_FECNACI", "id" => "fieldContFecnaci")) ?>
</div>
<div class="large-2 columns">
<label for="fieldContFecinsc">FECHA DE INSCRIPCION</label>
</div>
<div class="large-4 columns">
<?php echo $this->tag->dateField(array("CONT_FECINSC", "id" => "fieldContFecinsc")) ?>
</div>
</div>
I previously used javascript. How would you do in Phalcon?
<script type="text/javascript">
$(document).on('ready', function () {
var now = new Date();
var month = (now.getMonth() + 1);
var day = now.getDate();
if (month < 10)
month = "0" + month;
if (day < 10)
day = "0" + day;
var today = now.getFullYear() + '-' + month + '-' + day;
$('#fieldContFecnaci').val(today);
$('#fieldContFecinsc').val(today);
});
</script>
I can not use the function now gives me an error