Fakultas Ilmu Komputer UI

Commit 5adbfdaa authored by Muhammad Rafif Elfazri's avatar Muhammad Rafif Elfazri
Browse files

Merge branch 'dev-rafif' into 'development'

Dev rafif

See merge request !57
parents 3d7c2c19 bb3f9ebc
Pipeline #79440 passed with stages
in 7 minutes and 30 seconds
......@@ -73,7 +73,7 @@ class KegiatanSerializerRead(KegiatanSerializer):
time = obj.time_start
zona_waktu = obj.zona_waktu
time = time_converter(time, zona_waktu)
return time.strftime('%Y-%m-%dT%H:%M')
return time.strftime('%Y-%m-%d %H:%M')
def get_time_end(self, obj):
time = obj.time_end
......@@ -81,8 +81,7 @@ class KegiatanSerializerRead(KegiatanSerializer):
if time is None:
return None
time = time_converter(time, zona_waktu)
return time.strftime('%Y-%m-%dT%H:%M')
return time.strftime('%Y-%m-%d %H:%M')
class KomentarKegiatanSerializer(serializers.ModelSerializer):
kegiatan = serializers.IntegerField(source='kegiatan.id', read_only=True)
......
......@@ -58,15 +58,15 @@ class InformasiFasilitasTest(TestCase):
time_end = timezone.now() + timedelta(days=2)
time_start_zone = {
"WIB": time_start.astimezone(TIMEZONE_INDONESIA["WIB"]).strftime("%Y-%m-%dT%H:%M%z"),
"WITA": time_start.astimezone(TIMEZONE_INDONESIA["WITA"]).strftime("%Y-%m-%dT%H:%M%z"),
"WIT": time_start.astimezone(TIMEZONE_INDONESIA["WIT"]).strftime("%Y-%m-%dT%H:%M%z"),
"WIB": time_start.astimezone(TIMEZONE_INDONESIA["WIB"]).strftime("%Y-%m-%d %H:%M%z"),
"WITA": time_start.astimezone(TIMEZONE_INDONESIA["WITA"]).strftime("%Y-%m-%d %H:%M%z"),
"WIT": time_start.astimezone(TIMEZONE_INDONESIA["WIT"]).strftime("%Y-%m-%d %H:%M%z"),
}
time_end_zone = {
"WIB": time_end.astimezone(TIMEZONE_INDONESIA["WIB"]).strftime("%Y-%m-%dT%H:%M%z"),
"WITA": time_end.astimezone(TIMEZONE_INDONESIA["WITA"]).strftime("%Y-%m-%dT%H:%M%z"),
"WIT": time_end.astimezone(TIMEZONE_INDONESIA["WIT"]).strftime("%Y-%m-%dT%H:%M%z"),
"WIB": time_end.astimezone(TIMEZONE_INDONESIA["WIB"]).strftime("%Y-%m-%d %H:%M%z"),
"WITA": time_end.astimezone(TIMEZONE_INDONESIA["WITA"]).strftime("%Y-%m-%d %H:%M%z"),
"WIT": time_end.astimezone(TIMEZONE_INDONESIA["WIT"]).strftime("%Y-%m-%d %H:%M%z"),
}
# mock_kegiatan_test = {
......
......@@ -202,7 +202,7 @@ SOCIALACCOUNT_PROVIDERS = {
LOGIN_REDIRECT_URL = '/'
REST_FRAMEWORK = {
'DATETIME_FORMAT': "%Y-%m-%dT%H:%M%z",
'DATETIME_FORMAT': "%Y-%m-%d %H:%M%z",
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10,
'DEFAULT_AUTHENTICATION_CLASSES': [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment