-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
394 - Converter data no formato brasileiro para uma representação textual #415
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 99.78% 99.81% +0.02%
==========================================
Files 18 20 +2
Lines 472 542 +70
==========================================
+ Hits 471 541 +70
Misses 1 1 ☔ View full report in Codecov by Sentry. |
Converts a given date in brazilian format to its textual representation. 394
tests/test_date.py
Outdated
def testMonthEnum(self): | ||
for day, month in self.months_year: | ||
mont = MonthsEnum(day) | ||
self.assertEqual(mont.mont_name, month) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def testMonthEnum(self): | |
for day, month in self.months_year: | |
mont = MonthsEnum(day) | |
self.assertEqual(mont.mont_name, month) | |
def testMonthEnum(self): | |
for mont_number, month in self.months_year: | |
mont = MonthsEnum(month_number) | |
self.assertEqual(mont.mont_name, month) |
@@ -98,7 +98,7 @@ emulate bash -c '. .../bin/activate' | |||
Para testar se o ambiente virtual está ativo corretamente, execute o comando e verifique se a resposta é algo parecido com a seguinte: | |||
|
|||
```sh | |||
$ poetry env inf | |||
$ poetry env info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boaa!! Obrigada pelos olhos de lince!! 👀
README.md
Outdated
Exemplo: | ||
|
||
````python | ||
>>> from brutils.date import convert_date_to_text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Só para entrar no padrão dos outros imports :)
>>> from brutils.date import convert_date_to_text | |
>>> from brutils import convert_date_to_text |
README_EN.md
Outdated
Example: | ||
|
||
````python | ||
>>> from brutils.date import convert_date_to_text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> from brutils.date import convert_date_to_text | |
>>> from brutils import convert_date_to_text |
brutils/data/enums/months.py
Outdated
DEZEMBRO = 12 | ||
|
||
@property | ||
def mont_name(self) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def mont_name(self) -> str: | |
def month_name(self) -> str: |
brutils/date.py
Outdated
date_string = ( | ||
day_string.capitalize() | ||
+ " de " | ||
+ month.mont_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ month.mont_name | |
+ month.month_name |
tests/test_date.py
Outdated
def testMonthEnum(self): | ||
for day, month in self.months_year: | ||
mont = MonthsEnum(day) | ||
self.assertEqual(mont.mont_name, month) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def testMonthEnum(self): | |
for day, month in self.months_year: | |
mont = MonthsEnum(day) | |
self.assertEqual(mont.mont_name, month) | |
def testMonthEnum(self): | |
for day, month in self.months_year: | |
month = MonthsEnum(day) | |
self.assertEqual(month.month_name, month) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Na verdade os nomes do teste em si estavam errados, acabei de alterá-los para isso:
def testMonthEnum(self):
for number_month, name_month in self.months_year:
month = MonthsEnum(number_month)
self.assertEqual(month.month_name, name_month)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boa, @BeneBr, mandaram ver!! Obrigada pela contribuição, ajustei apenas alguns detalhes, qualquer coisa só chamar a gente!! 🥇
Assim que obtiver o approve, faço squash dos commits. |
Alguém poderia aprovar para eu poder fazer o merge? |
Descrição
Possibilitar aos usuários uma forma de ter uma representação textual de uma data no formato brasileito (dd/mm/aaa)
Mudanças Propostas
Adicionada uma nova dependência
num2words
no qual transforma um determinado número em uma representação textual em vários idiomas;Adicionada uma free function
convert_date_to_text
onde os usuários podem passar uma string no formato dd/mm/aaaa e obter uma representação textual;Checklist de Revisão
Comentários Adicionais (opcional)
Issue Relacionada
Closes #394