Skip to main content


 

Symptoms

 


How to change the Worklist control to always show dates
 

 

Diagnoses

 


The Worklist control shows the time of submission if the date is the current day. The JavaScript workaround below will overwrite this with its parent elements title value (which should be the current date).
 

 

Resolution

Workaround:
The following jQuery script replaces any 'Task Start Date' fields on the Worklist control that show a time (instead of the current day) with the current date (on the local display only, no backend data is changed).

Steps:
- Create an invisible, literal Data Label, and add an expression to it with the following text:
---

<script>
   var regex = /^(1e0-2]|^1-9]):]0-5]90-9] (a|p|A|P)(m|M)$/;
   $.each($('.text-underline'), function(index, element) {
      if ( regex.test( $(element).text() ) && element.parentNode.title ) {
         $(element).text( element.parentNode.title );
      }
   });
</script>

---
- Create a new (unbound) rule named 'Worklist Fix' with the following actions:
- Transfer data: Check the literal Data Label but leave the input blank
- Transfer data: Check the literal Data Label and drag in the jQuery Expression

- Add a new rule 'When a control on the Form/View raises an event, targeting the Worklist control and its 'Refreshed' method with the following action:
- Use the 'execute another rule' action to execute the 'Worklist Fix' rule inside this rule

 

 



 
Be the first to reply!

Reply