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

Bug: timezone perlu di-setting #793

Closed
eddieridwan opened this Issue Feb 15, 2018 · 7 comments

Comments

2 participants
@eddieridwan
Collaborator

eddieridwan commented Feb 15, 2018

Diperlukan untuk hosting di mana date.timezone tidak ada setting default dan juga di mana setting timezone hosting tidak sesuai dengan timezone lokal. Kalau tidak ada setting default, akan terjadi error di mana function opensid_helper umur() akan menghasilkan null.

//  https://stackoverflow.com/questions/16765158/date-it-is-not-safe-to-rely-on-the-systems-timezone-settings
	date_default_timezone_set('Asia/Makassar');//ganti ke timezone lokal

Tambahkan ke Pengaturan > Setting Aplikasi.

@eddieridwan eddieridwan added the bug label Feb 15, 2018

@eddieridwan

This comment has been minimized.

Collaborator

eddieridwan commented Feb 15, 2018

Timezone yang dikenal PHP ada di http://id1.php.net/manual/en/timezones.asia.php. Mungkin sediakan pilihan hanya timezone Indonesia.

@ombimo

This comment has been minimized.

Contributor

ombimo commented Feb 15, 2018

Asia/Jakarta
Asia/Jayapura
Asia/Makassar

timezonenya cuma ada 3 itu kan om ?

@eddieridwan

This comment has been minimized.

Collaborator

eddieridwan commented Feb 15, 2018

Ya, sepertinya begitu. Ada tiga zona waktu di Indonesia.

@ombimo

This comment has been minimized.

Contributor

ombimo commented Feb 15, 2018

wah sepertinya harus buat base_controller supaya bisa set_timezone di semua halaman, biar tidak terlalu banyak copy-paste code ke semua controller, gmna om ?

@ombimo

This comment has been minimized.

Contributor

ombimo commented Feb 15, 2018

tp kalau tanpa ambil config ke database, bisa ditaruh di config. tetapi kalau mau mengubah timezone harus edit php nya langsung

@eddieridwan eddieridwan added this to SEDANG DIKERJAKAN in Rilis yang sedang dikerjakan Feb 23, 2018

@eddieridwan eddieridwan self-assigned this Feb 23, 2018

eddieridwan added a commit that referenced this issue Feb 23, 2018

#793: Sediakan setting zona waktu untuk mencegah error pada entri tan…
…ggal/waktu. Default zona waktu Asia/Jakart (yaitu Waktu Indonesia Barat
@eddieridwan

This comment has been minimized.

Collaborator

eddieridwan commented Feb 23, 2018

@ombimo : hanya tinggal ditambahkan ke Pengaturan > Setting Aplikasi.

  1. tambah setting timezone melalui migrasi di database_model.php
  2. di setting_model.php, jalankan date_default_timezone_set() untuk setting timezone PHP

setting_model.php berfungsi sebagai konfigurasi aplikasi tambahan, yang settingnya disimpan di database.

Sudah dikerjakan dan dicommit ke master.

Kalau ada usul perbaikan, silakan.

@eddieridwan eddieridwan moved this from SEDANG DIKERJAKAN to SUDAH DI MASTER in Rilis yang sedang dikerjakan Feb 23, 2018

@ombimo

This comment has been minimized.

Contributor

ombimo commented Feb 23, 2018

wah ternyata ada autoloadnya ya, hihihi
soalnya pas mau code, bingung date_default_timezone_set mau ditaruh dmna biar di semua tempat jalan.
*baru pertama pegang CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment