-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Core] Add config option for projects to specify how they want dates to be displayed #5004
Conversation
SQL/0000-00-03-ConfigTables.sql
Outdated
@@ -252,3 +253,4 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, 't1' FROM ConfigSettings WHER | |||
INSERT INTO Config (ConfigID, Value) SELECT ID, 't2' FROM ConfigSettings WHERE Name="modalities_to_deface"; | |||
INSERT INTO Config (ConfigID, Value) SELECT ID, 'pd' FROM ConfigSettings WHERE Name="modalities_to_deface"; | |||
INSERT INTO Config (ConfigID, Value) SELECT ID, 'false' FROM ConfigSettings WHERE Name="usePwnedPasswordsAPI"; | |||
INSERT INTO Config (ConfigID, Value) SELECT ID, 'Y-m-d' FROM ConfigSettings WHERE Name="dateDisplayFormat"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value here is the ISO date standard.
Need to add Raisinbread changes. |
I'm getting the error:
I don't know why it says the config setting doesn't exist... the patch looks right to me and worked on my VM. Am I doing something wrong that makes it so Travis can't see this config setting? |
@johnsaigle it's becaude the RB changes have not been done. the RB data replaces the defualt configuration to mimic a real project sourcing the patches |
@ridz1208 Thanks for clarifying. I'll fix this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what we want here is to use some kind of php date functionality that grabs dates in sql format (yyyy-mm-dd) and converts it to the desired format using the dateDisplayFormat config. i.e. php's date() function except this function returns the current timestamp. we need an accompanying piece that does something useful with the default 'Y-m-d'
@zaliqarosli You're right, the examples I used didn't actually make sense. I went into issue tracker like you suggested and changed the dates that way. Rather than pass an unformatted date into JS and format it there, I created a function to convert the date format in PHP before it gets passed into the front-end. I chose to do this because the config setting is a PHP date format such as I updated the PR description with testing instructions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebasing not quite successful ... changes to edit_user.class.inc not necessary - issue tracker changes should suffice!
'language' => 'en', | ||
'format' => 'YMd', | ||
'format' => $dateFormat, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i believe this date option is for a date input element. this PR wants to format date displays i.e. date shown as string
raisinbread/RB_files/RB_Config.sql
Outdated
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (99,65,'true'); | ||
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (100,19,'false'); | ||
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (101,65,'true'); | ||
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (102,101,'Y-m-d H:i:s'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes are unintentionally affecting other configs
raisinbread/RB_files/RB_Config.sql
Outdated
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (103,102,'/data/document_repository_uploads/'); | ||
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (104,103,'/data/data_release_uploads/'); | ||
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (105,104,'Y-m-d H:i:s'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have this config duplicated on line 98
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll redo the RB export
@johnsaigle from what I can see, in RB you are adding the config setting but not the actual config value, which means the default will be used in the issue tracker which is ATOM is that your intent ? |
No I think I need to fix that. I was having some issues with raisinbread exporting + rebasing |
@johnsaigle let me know if you need help with it |
Feel free to do it. I think you should be abel to push to my branch. Let me know if there's an issue |
Update RB files Improve wording of SQL description text Apply suggestions from code review Revert URL and host changes Fix Raisinbread files Add issue tracker example and Utility function Apply suggestions from code review (remove bad config data) Update raisinbread/RB_files/RB_Config.sql remove old example Update raisinbread/RB_files/RB_Config.sql Revert another example fix typo Change defauly format to include hours, minutes, and seconds Update Raisinbread files after rebase update raisinbread change rb again add default formt in utility function remove extra lines from rebase Redo RB changes Revert changes to RB admin user remove bad code from rebase revert changes to edit user
@driusan all urs |
Brief summary of changes
Following today's meeting, this adds a config option to allow projects to specify how they want dates to be displayed in LORIS.
This PR only adds two quick examples of using this Config setting; it is by no means comprehensive.
Also, this will only take place in "PHP contexts" and not within JS date elements as these are OS- and locale-dependent.
Testing
Last Updated
column.ymd
.Last Updated
column should match the format you supplied in step 3.