Skip to content

Commit

Permalink
1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensdemelo committed Dec 16, 2022
1 parent ee2252d commit 67162e2
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
- name: test
run: flutter test --coverage

# Run Codecov
- name: Codecov
- name: codecov
uses: codecov/[email protected]

- uses: bluefireteam/flutter-gh-pages@v7
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.9.0
- Novos métodos em `UtilData`: obterDateTimeHora e obterDateTimeHoraMinuto.
- Ajustes no worflow.yml

## 1.8.1
- Atualiza README e `pubspec.yaml`.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ A classe `UtilData` possui métodos que facilitam obter o valor de um objeto `Da
- `UtilData.obterMes`
- `UtilData.obterDia`
- `UtilData.obterDateTime`
- `UtilData.obterDateTimeHora`
- `UtilData.obterDateTimeHoraMinuto`

A classe `UtilBrasilFields` possui métodos que facilitam obter os valores CEP, KM, CPF e CPNJ já formatados:

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.8.1"
version: "1.9.0"
characters:
dependency: transitive
description:
Expand Down
8 changes: 4 additions & 4 deletions lib/src/util/util_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ class UtilData {

/// Retorna um objeto [DateTime] de acordo com a data informada.
///
/// Informar a String `data` no formato `DD/MM/AAAA`
/// Informar a string `data` no formato `DD/MM/AAAA`
static DateTime obterDateTime(String data) {
initializeDateFormatting();
return DateFormat.yMd("pt_BR").parse(data);
}

/// Retorna um objeto [DateTime] de acordo com a data informada.
///
/// Informar a String `data` no formato `DD/MM/AAAA HH:MM`
/// Informar a string `data` no formato `DD/MM/AAAA HH:MM`
static DateTime obterDateTimeHora(String data) {
initializeDateFormatting();
return DateFormat.yMd("pt_BR").add_jm().parse(data);
}

/// Retorna um objeto [DateTime] de acordo com a data informada.
///
/// Informar a String `data` no formato `HH:MM`
static DateTime obterHoraMinuto(String data) {
/// Informar a string `data` no formato `HH:MM`
static DateTime obterDateTimeHoraMinuto(String data) {
initializeDateFormatting();
return DateFormat.jm("pt_BR").parse(data);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: brasil_fields
description: O jeito mais fácil de utilizar padrões e formatos brasileiros em seu projeto Dart.
version: 1.8.1
version: 1.9.0
homepage: https://github.com/flutterbootcamp/brasil_fields
repository: https://github.com/flutterbootcamp/brasil_fields
issue_tracker: https://github.com/flutterbootcamp/brasil_fields/issues
Expand Down
2 changes: 1 addition & 1 deletion test/util_brasil_fields_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void main() {

test('31/12/2022 23:41:06', () {
const data = '23:41';
var dateTime = UtilData.obterHoraMinuto(data);
var dateTime = UtilData.obterDateTimeHoraMinuto(data);
expect(dateTime, DateTime(1970, 01, 01, 23, 41, 00));
});
});
Expand Down

0 comments on commit 67162e2

Please sign in to comment.