Is it possible to change/put pipe to format a specific column in Angular 2 on button click? Like for example I have a table with 'Name' and 'Hours' columns, when I click a button the data displayed for 'Hours' should be converted into days and vice-versa.
<button class="btn btn-secondary" (click)="convertToDays()">Days</button>
<button class="btn btn-secondary" (click)="convertToHours()">Hours</button>
<tbody>
<td>{{availableLeave.hours}}</td>
</tbody>
convertToDays(){
//put pipe to format availableLeave.hours to display as days ex.('48' hours should be displayed as '2' days)
}
convertToHours(){
//will just revert the original formatting of availableLeave.hours which is in hour format
}