replaced the formatting function with angular date formatter