Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
bisago
bisago-fe
Commits
67cc76a8
Verified
Commit
67cc76a8
authored
Jun 05, 2021
by
Muhammad Ariq Basyar
Browse files
[CHORE] fix test, now komentar posting have default datetime format
parent
26c635ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/model/komentar.dart
View file @
67cc76a8
import
'package:intl/intl.dart'
;
import
'package:json_annotation/json_annotation.dart'
;
import
'package:bisaGo/config/custom_serializer.dart'
;
...
...
@@ -16,7 +17,7 @@ class KomentarModel {
final
String
namaLokasi
;
final
String
deskripsi
;
final
String
creator
;
@JsonKey
(
name:
'date_time'
,
fromJson:
CustomSerializer
.
stringToDateTime
)
@JsonKey
(
name:
'date_time'
,
fromJson:
_
stringToDateTime
)
final
DateTime
dateTime
;
final
String
tag
;
final
List
<
String
>
disabilitas
;
...
...
@@ -48,3 +49,7 @@ class KomentarModel {
Map
<
String
,
dynamic
>
toJson
()
=
>
_$KomentarModelToJson
(
this
);
}
DateTime
_stringToDateTime
(
String
date
)
{
return
DateFormat
(
'dd-MM-yyyy hh:mm'
)
.
parse
(
date
);
}
lib/model/komentar.g.dart
View file @
67cc76a8
...
...
@@ -27,7 +27,7 @@ KomentarModel _$KomentarModelFromJson(Map<String, dynamic> json) {
namaLokasi:
json
[
'nama_lokasi'
]
as
String
,
deskripsi:
json
[
'deskripsi'
]
as
String
,
creator:
json
[
'creator'
]
as
String
,
dateTime:
CustomSerializer
.
stringToDateTime
(
json
[
'date_time'
]
as
String
),
dateTime:
_
stringToDateTime
(
json
[
'date_time'
]
as
String
),
tag:
json
[
'tag'
]
as
String
,
disabilitas:
(
json
[
'disabilitas'
]
as
List
)
?.
map
((
e
)
=
>
e
as
String
)
?.
toList
(),
...
...
lib/model/komentar_posting_kegiatan.g.dart
View file @
67cc76a8
...
...
@@ -29,7 +29,7 @@ KomentarPostingKegiatanModel _$KomentarPostingKegiatanModelFromJson(
id:
json
[
'id'
]
as
int
,
creator:
json
[
'creator'
]
as
String
,
deskripsi:
json
[
'deskripsi'
]
as
String
,
created:
_
stringToDateTime
(
json
[
'created'
]
as
String
),
created:
CustomSerializer
.
stringToDateTime
(
json
[
'created'
]
as
String
),
creatorEmail:
json
[
'creator_email'
]
as
String
,
creatorPicture:
json
[
'creator_picture'
]
as
String
,
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment