Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Users should default to timezone configured in api.php #771

Closed
samvasko opened this issue Feb 13, 2019 · 7 comments
Closed

Users should default to timezone configured in api.php #771

samvasko opened this issue Feb 13, 2019 · 7 comments
Labels
enhancement New feature or request
Projects

Comments

@samvasko
Copy link
Contributor

samvasko commented Feb 13, 2019

Bug Report

Default timezone for users is 'America/New_York'.

Expected Behavior

The users inherit the timezone from the server api configuration.

Actual Behavior

Timezone is set to 'America/New_York'.

Other Context & Screenshots

Relevant code for admin creation:

https://github.com/directus/api/blob/368684beeb226c1b33af72619abf68ed7631e55a/src/core/Directus/Util/Installation/InstallerUtils.php#L251

Schema configuring the database to default to NYC
https://github.com/directus/api/blob/6898e21872f611be3b9f642c920587a9e707acdc/src/schema.sql#L563

Technical Details

  • Device: Desktop
  • OS: MacOs High Sierra
  • Web Server: nginx
  • PHP Version: 7.2
  • Database: Mysql 5.2
  • Install Method: docker 2.0.17 and 7.0.17
@samvasko samvasko changed the title Users should default to app timezone Users should default to timezone configured in api.php Feb 13, 2019
@benhaynes
Copy link
Sponsor Member

@wellingguzman @rijkvanzanten — is this App or API? I guess we want to have users created directly in the API to follow this too.

@benhaynes benhaynes added the enhancement New feature or request label Feb 13, 2019
@wellingguzman
Copy link
Contributor

@benhaynes This is API.

Hey @samvasko to make it clear when you refer to the server timezone you referring to the actual server timezone, and not the php default timezone on the server (php.ini), correct?

@wellingguzman
Copy link
Contributor

Based on the title you are talking about the timezone in the project configuration to be used instead of the static America/New_York.

In other hand the schema.sql file will be always set to America/New_York, (reads cannot be configured) we generated this file from the migrations files.

@samvasko
Copy link
Contributor Author

I would expect the default timezone to be the one in api.php. I that one is not configured then it should be the system one. 🤷‍♂️

You are right. I thought that the .sql was the source. The migration contains New York as well.
https://github.com/directus/api/blob/368684beeb226c1b33af72619abf68ed7631e55a/migrations/db/schemas/20180220023248_create_users_table.php#L64

@samvasko
Copy link
Contributor Author

samvasko commented Feb 13, 2019

I guess the options would be to either:

  1. Read the config file during migration and admin creation
  2. Default to UTC

@wellingguzman
Copy link
Contributor

You are right. I thought that the .sql was the source. The migration contains New York as well.

Correct, but we can configure that to fetch the default timezone before creating the project.

I guess the options would be to either:

  1. Read the config file during migration and admin creation
  2. Default to UTC

Exactly, fallback to something when the default timezone is empty.

@wellingguzman wellingguzman added this to To do in v2.0.18 Feb 13, 2019
@wellingguzman wellingguzman moved this from To do to In progress in v2.0.18 Feb 13, 2019
@samvasko
Copy link
Contributor Author

🍾

@wellingguzman wellingguzman moved this from In progress to Done in v2.0.18 Feb 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
No open projects
v2.0.18
  
Done
Development

No branches or pull requests

3 participants