# |
Feb 9th 2018, 21:33 |
kevin |
I changed it in the app to be -7 GMT |
# |
Feb 9th 2018, 21:33 |
ricksaccous |
lol |
# |
Feb 9th 2018, 21:33 |
ricksaccous |
I don't even know |
# |
Feb 9th 2018, 21:33 |
ricksaccous |
is -7 GMT same as UTC? |
# |
Feb 9th 2018, 21:33 |
ricksaccous |
the frozenTime object assumes UTC i think |
# |
Feb 9th 2018, 21:32 |
kevin |
any issue with my single point of truth being -7 GMT? |
# |
Feb 9th 2018, 21:32 |
ricksaccous |
that way you have a single point of truth when you change the Timezone per user |
# |
Feb 9th 2018, 21:31 |
ricksaccous |
but also, you should be storing times in your DB in UTC |
# |
Feb 9th 2018, 21:31 |
ricksaccous |
that's shown in the Helper docs i linked you |
# |
Feb 9th 2018, 21:31 |
kevin |
so my DB is in -7GMT, but I want to let people select their own timezone and have the displayed time adjust |
# |
Feb 9th 2018, 21:30 |
kevin |
yeah but im trying to implement account based timezones |
# |
Feb 9th 2018, 21:29 |
ricksaccous |
but your entity should already be a FrozenTime object |
# |
Feb 9th 2018, 21:29 |
ricksaccous |
actually it's fine i guess |
# |
Feb 9th 2018, 21:29 |
ricksaccous |
and use ummm |
# |
Feb 9th 2018, 21:29 |
ricksaccous |
it's actually best practice to not use that helper |
# |
Feb 9th 2018, 21:28 |
ricksaccous |
https://book.cakephp.org/3.0/en/views/helpers/time.html |
# |
Feb 9th 2018, 21:27 |
ricksaccous |
https://api.cakephp.org/3.3/class-Cake.View.Helper.TimeHelper.html |
# |
Feb 9th 2018, 21:27 |
ricksaccous |
there is no parse method |
# |
Feb 9th 2018, 21:26 |
kevin |
that line was pretty close… Call to a member function nice() on null |
# |
Feb 9th 2018, 21:26 |
ricksaccous |
so if you use html helper you would also do $this->Html |
# |
Feb 9th 2018, 21:26 |
ricksaccous |
rather |
# |
Feb 9th 2018, 21:26 |
ricksaccous |
well not all the same, they follow the same conventions |
# |
Feb 9th 2018, 21:26 |
ricksaccous |
all helpers are the same, you can see it in TimeHelper documentation |
# |
Feb 9th 2018, 21:26 |
ricksaccous |
it's a helper |
# |
Feb 9th 2018, 21:26 |
kevin |
is there any where I could have looked to find this without asking in slack? |
# |
Feb 9th 2018, 21:25 |
ricksaccous |
;) |
# |
Feb 9th 2018, 21:25 |
ricksaccous |
$this->Time->parse($widget['time'])->nice('-7:00'); |
# |
Feb 9th 2018, 21:25 |
ricksaccous |
$this->Time->parse(); |
# |
Feb 9th 2018, 21:23 |
kevin |
So how do you use it them? If I try to use $time = Time::parse($widget[‘time’]); $time->nice(‘-07:00’), I get errors about using Time:: |
# |
Feb 9th 2018, 21:05 |
night_wulfe |
Does anyone unit test their model relationships, or is that considered testing the framework? |
# |
Feb 9th 2018, 20:58 |
ricksaccous |
you don't have to do any of that |
# |
Feb 9th 2018, 20:58 |
ricksaccous |
it's included by default through Core or something |
# |
Feb 9th 2018, 20:58 |
ricksaccous |
nah |
# |
Feb 9th 2018, 20:04 |
kevin |
for TimeHelper, its used in the view, but do you put the ‘use Cake\View\Helper\TimeHelper’ line in the controller, or at the top of the viw? |
# |
Feb 9th 2018, 19:53 |
devito |
afterFind method of a model, Do i need to also re call $this->save($entity)? |
# |
Feb 9th 2018, 19:50 |
aro |
to save it |
# |
Feb 9th 2018, 19:50 |
aro |
mark, with your tag plugin, do all we need is a comma delimited field called 'tag_list' with the model that is being tagged? |
# |
Feb 9th 2018, 19:48 |
kevin |
is there something baked into cakephp that can automagically handle timezones? like, if I have a timezone variable for the users session |
# |
Feb 9th 2018, 19:02 |
madrid998 |
ah yes |
# |
Feb 9th 2018, 19:02 |
dereuromark |
array diff methods on table->schema() fields |
# |
Feb 9th 2018, 19:02 |
madrid998 |
What is the best way to query a table of 30 fields for all fields, expect 1 of the fields. Do I need to list all fields, or is there a way to use a wildcard or 'omit' 1 field? |