Utilicé un gran script de CJK sin ningún problema, pero no estoy seguro de lo que pasa, recientemente me di cuenta de algunos resultados no válidos:
startDate = "2019-05-31" (Formato US) Luego se convierte a "31-05-2019".
MiFecha (ahora) = 01-06-2019
Resultado 31 días
set creationDate to "2019-05-31"
set [YearValCreation, MonthValCreation, dayValCreation] to the words of creationDate
tell (current date) to set startDate to dayValCreation & "-" & MonthValCreation & "-" & YearValCreation --->>> "31-05-2019"
set MyDate to short date string of (current date) --->>> "01/06/2019"
set [dayVal, MonthVal, YearVal] to the words of MyDate
tell (current date) to set MyDate to dayVal & "-" & MonthVal & "-" & YearVal ---->>>> "01-06-2019"
set DateText to ""
on timeInterval from startDate to endDate by units : 1
tell (current date) to set [startDate, ¬
day, [day, its month, year]] to ¬
[it, 1, words of startDate]
tell (current date) to set [endDate, ¬
day, [day, its month, year]] to ¬
[it, 1, words of endDate]
(endDate - startDate) / units
end timeInterval
set dayResult to timeInterval from startDate to MyDate by days
set dayResult to (round (dayResult * 1)) / 1 as integer
--->>> 31
Sólo liberar si la fecha es 30-05-2019 en lugar de 31-05-2019 tengo un resultado correcto