This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Se requiere la instalación del paquete Spatie/IcalendarGenerator vía composer para utilizar | |
* funcionalidad de generación de archivos iCalendar. | |
* El paquete puede ser instalado con el comando "composer require spatie/icalendar-generator" | |
* Para más información, consulte la documentación en https://github.com/spatie/icalendar-generator | |
*/ | |
namespace App\Mail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Rules; | |
use Illuminate\Contracts\Validation\Rule; | |
class Rut implements Rule | |
{ | |
/** | |
* Create a new rule instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function tildesHtml($cadena) { | |
return str_replace(array("á","é","í","ó","ú","ñ","Á","É","Í","Ó","Ú","Ñ"), array("á","é","í","ó","ú","ñ","Á","É","Í","Ó","Ú","Ñ"), $cadena); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function check_in_range($fecha_inicio, $fecha_fin, $fecha){ | |
$fecha_inicio = strtotime($fecha_inicio); | |
$fecha_fin = strtotime($fecha_fin); | |
$fecha = strtotime($fecha); | |
if(($fecha >= $fecha_inicio) && ($fecha <= $fecha_fin)) { | |
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
$(":input").prop("disabled", true); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$(document).ready(function(){ | |
$("#fechainicio").datepicker({ | |
todayBtn: 1, | |
autoclose: true, | |
}).on('changeDate', function (selected) { | |
var minDate = new Date(selected.date.valueOf()); | |
$('#fechatermino').datepicker('setStartDate', minDate); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="text" onkeypress="return filterFloat(event,this);"> | |
<script> | |
function filterFloat(evt,input){ | |
// Backspace = 8, Enter = 13, ‘0′ = 48, ‘9′ = 57, ‘.’ = 46, ‘-’ = 43 | |
var key = window.Event ? evt.which : evt.keyCode; | |
var chark = String.fromCharCode(key); | |
var tempValue = input.value+chark; | |
if(key >= 48 && key <= 57){ | |
if(filter(tempValue)=== false){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rut | |
oninput="this.value = this.value.replace(/[^0-9Kk.]/g, '').replace(/(\..*)\./g, '$1');" | |
// Numeros | |
onkeypress="return /[0-9]/i.test(event.key)" | |
// Letras | |
onkeypress="return /[aA-zZ ]/i.test(event.key)" | |
// maxLength | |
oninput="if(this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fecha = new DateTime(); # Para obtener desde una fecha determinada sería de la siguente forma: $fecha = new DateTime('2019-12-11'); | |
// obtener primer día del mes | |
$primer = $fecha; | |
$primer->modify('first day of this month'); | |
$primer = $primer->format('Y-m-d'); | |
echo $primer; | |
// obtener último día del mes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
setlocale(LC_ALL, 'es_ES'); | |
foreach ($listado as $key => $venta) { | |
$fecha = $venta->fecha; | |
$date = new Datetime("$fecha"); | |
$fecha = strftime("%d %B %Y", $date->getTimestamp()); | |
$listado[$key]->fecha = $fecha; | |
} |
NewerOlder