FIX: Fechas revisadas.
This commit is contained in:
@ -251,12 +251,21 @@
|
||||
event.preventDefault()
|
||||
const url = '{{$urls->api}}/venta/{{$venta->id}}/escriturar'
|
||||
const body = new FormData(event.currentTarget)
|
||||
body.set('fecha', $('#fecha').calendar('get date').toISOString())
|
||||
if (body.get('fecha_pago') !== '') {
|
||||
body.set('fecha_pago', $('#fecha_pago').calendar('get date').toISOString())
|
||||
const fecha = $('#fecha').calendar('get date')
|
||||
body.set('fecha', [fecha.getFullYear(), fecha.getMonth()+1, fecha.getDate()].join('-'))
|
||||
const $fechaPago = $('#fecha_pago')
|
||||
if ($fechaPago.length > 0) {
|
||||
const fechaPago = $fechaPago.calendar('get date')
|
||||
if (fechaPago !== null) {
|
||||
body.set('fecha_pago', [fechaPago.getFullYear(), fechaPago.getMonth()+1, fechaPago.getDate()].join('-'))
|
||||
}
|
||||
}
|
||||
if (body.get('fecha_reajuste') !== '') {
|
||||
body.set('fecha_reajuste', $('#fecha_reajuste').calendar('get date').toISOString())
|
||||
const $fechaReajuste = $('#fecha_reajuste')
|
||||
if ($fechaReajuste.length > 0) {
|
||||
const fechaReajuste = $fechaReajuste.calendar('get date')
|
||||
if (fechaReajuste !== null) {
|
||||
body.set('fecha_reajuste', [fechaReajuste.getFullYear(), fechaReajuste.getMonth()+1, fechaReajuste.getDate()].join('-'))
|
||||
}
|
||||
}
|
||||
fetchAPI(url, {method: 'post', body}).then(response => {
|
||||
if (response.ok) {
|
||||
|
Reference in New Issue
Block a user