Calculate workdays between two dates - Script stop working!

Iron Contributor



I have classic SPO with a list that contains two date columns. There is a third colum that shows the number of working days between the dates from the other two columns. 

The number of days is calculated by a script that is in the same page inside a script editor webpart. 

Whe the list opens the number of days are shown in the correspongin column but if I change the view this column doesn't show the number of days. The same happens if I filter the list.


I suspect that the script doesn't load when I change the view or filter the column, but I have also noted that in the secondary view there is not any script editor webpart in the page, it seems like the webpart exists only in the main view, can that be correct? 


How can I make the script run when I filter the list or change the view? 


I am using jQuery and the code is inside a $(document). And I also tried to put the script in a js file and call it from the masterpage but the result is the same. 


UPDATE: I tested the list again and it seems that the script still woring when changing the view. The problem remains when filtering the list:



Best regards


0 Replies