Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Restar 2 fechas pero solo considerando la jornada laboral

Wilber Ballestero August 25, 2023

Buenos días comunidad, tengo 2 campos de fechas y quiero restarlo, esta operación ya puedo hacerla, ¿ hay alguna forma de que esta resta de fechas sólo considere tiempo efectivo de la jornada laboral ? por ejemplo, mi jornada es de Luenes a viernes de 8:00am a 5:30pm, todas las restas deben considerar este horario.

Muchas gracias.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
August 25, 2023

Hola @Wilber Ballestero ,

¿Qué unidad de tiempo desea utilizar para los resultados? ¿Está utilizando campos de solo fecha o campos de fecha/hora?

Existe una unidad de tiempo "businessDays" que considerará únicamente los días hábiles al calcular la diferencia.

Esa opción aparece en la documentación de la función diff.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#--

 

---

Hello,

What time unit do you want to use for the results? Are you using date only fields or date/time fields.

There is a "businessDays" time unit that will consider only the working days when calculating the difference.

That option is listed in the documentation for the diff function.

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#--

 

Subtract 2 dates but only considering the working day

Good morning community, I have 2 date fields and I want to subtract them, I can already do this operation, is there any way that this date subtraction only considers effective time of the working day? For example, my workday is from Monday to Friday from 8:00 a.m. to 5:30 p.m., all subtractions must consider this schedule.

Thank you so much.

Wilber Ballestero August 25, 2023

Hola mi fórmula es esta:

{{#=}}{{issue.Tiempo en APROBACION}} + {{issue.Fecha en la que se detuvo el sobre.diff(issue.Fecha de inicio del sobre).seconds}}{{/}}

Son campos de fecha/hora, el resultado debe estar expresado en segundos pero sólo considerando "businessDays"

Trudy Claspill
Community Champion
August 25, 2023

No hay opciones para horas hábiles, minutos o segundos.

Puede tomar los resultados del uso de la opción de días hábiles y multiplicarlos por la cantidad de segundos en su horario laboral para un día hábil. Ese no sería un cálculo perfecto, ya que los tiempos especificados en los campos podrían ser parte de un día hábil.

Si desea ser más preciso, necesitará realizar cálculos adicionales para determinar la cantidad de segundos entre el primer valor de fecha/hora y el final de ese día hábil, y la cantidad de segundos entre el segundo valor de fecha/hora y el inicio. de ese día hábil y luego cuántos días hábiles hay entre esas dos fechas.

 

---

There are no options for business hours, minutes, or seconds.

You could take the results of using the business days option and multiply that by the number of seconds in your working hours for a business day. That would not be a perfect calculation since the times specified in the fields might be part of the way through a business day.

If you want to be more precise you would need to do extra calculations to determine the number of seconds between the first date/time value and the end of that business day, and the number of seconds between the second data/time value and the start of that business day, and then how many business days there are in between those two dates.

They are date/time fields, the result must be expressed in seconds but only considering "businessDays"

Wilber Ballestero August 25, 2023

Muchas gracias

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events