1
I am using a card that returns me actual data of the day, month and year. It’s actually four cards, two with year and month, and two with year, month and day.
The problem is that on my return I want to display in Portuguese-BR and that I can manipulate so that I can display not only the current day, but yesterday (for example). I’m using the html component:
{{ hoje | date:'MMMM' | uppercase }}
and in comoponente.ts I declare property today in that way:
hoje: number = Date.now();
This way is being displayed: the current day ok
Yesterday, I couldn’t find a way to fix it so that it shows
month: as I read in the documentation, I passed the 'MMMM' reference for the month to be displayed in full and on the other card only 'MMM' to display the first three letters. Returns me respectively: September and SEP. I would like to adjust the two situations. Translation and display for yesterday. I have tried injecting the LOCALE_ID
no providers of my Appcomponent, setting to en and now with only 'en', but unsuccessfully. Even in the attempts as some examples I saw, the date of the display in the browser disappears when I interpolate.
{{ hoje | date:'MMMM' | uppercase }}
-> SEPTEMBER I NEED = SEPTEMBER
{{ hoje | date:'MMM' | uppercase }}
-> SEP I need = SET
<td rowspan="2" class="dia-setado">{{ hoje | date:'dd' }}</td>
-> 25 I need it but I also need one that returns yesterday’s date.
It would be easier for you to post what is the format of the result you receive and what format you want to show on the screen.
– LeAndrade
@Leandrade ready. I edited directly in the question.
– Wanderson Bueno