-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add datetime picker and use ISO8601 format #38
Conversation
codeliner
commented
Oct 1, 2015
- user todo list is now powered by riot.js
- added bootstrap-datetimepicker to deadline input
- changed TodoDeadline to use ISO8601 format
- Adjusted deadline table column to store ISO8601
- user todo list is now powered with riot.js - added bootstrap-datetimepicker to deadline input - changed TodoDeadline to use ISO8601 format - Adjusted deadline table column to store ISO8601
@theDisco Date picker is added. Can you review? I also changed the date format in the TodoDeadline and type of deadline table column as preparation for handling user TZ correctly. You now receive an ISO8601 formatted date from the client. Only missing part is, that the |
}); | ||
</script> | ||
</script> | ||
<?php endif; ?> |
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.
missing new line at end of file
looks good on first sight, i will check out this branch and test tomorrow. |
Question: Does the bootstrap datetimer picker also work on mobile devices? |
@prolic New lines are added. Sorry ;) Regarding your question: I guess the datepicker also works on mobile devices. It is made for and works with bootstrap 3 so would be strange if it causes problems on a mobile device and it looks very mobile-ish :D. But tbh I'm not 100 % sure. It is the first time I use it. Just was looking for a datepicker with bootstrap support and this one got my attention because it includes time picking in a very smart fashion and works with moment.js which is really cool (the moment.isBefore/isAfter methods etc.) |
@@ -14,7 +14,7 @@ class Version20150924204612 extends AbstractMigration | |||
public function up(Schema $schema) | |||
{ | |||
$todo = $schema->getTable(Table::TODO); | |||
$todo->addColumn('deadline', 'datetime', ['default' => null, 'notnull' => false]); | |||
$todo->addColumn('deadline', 'string', ['default' => null, 'notnull' => false, 'length' => 30]); | |||
} | |||
|
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.
@codeliner Why do you prefer \Doctrine\DBAL\Types::STRING
over \Doctrine\DBAL\Types::DATETIMETZ
? Good databases like Postgres support storing TZ in a datetime field. Storing the value as a string will prevent you from selecting TODOs which deadline is today on a database level.
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.
Good question!
Basically because of this limitation
The purpose of read tables is to provide information in a query-friendly way. ISO8601 is a common standard and I would like to store datetime without the need to map it again.
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.
That was the reason why I named Postgres. My idea was to rather save the dates in UTC and handle the conversion on application side, but you are right, DateTime
handles TZs really well and if we don't need the datetime
type in the DB, you might as well save it as string in ISO8601
format.
Btw. Nice to have you here Wojtek. |
For selecting deadlines from a specific date we could add another view (db table). We can have as many projections as we want. |
I can add a deadline to a todo that is already done. |
@prolic it is nice to be here! You are right, the same goes for notifications etc. @codeliner sure #39 |
Great! @prolic Can we merge this one? |
Add datetime picker and use ISO8601 format