Side-note:
A lot of browsers still do not fully support that. Make sure that you at
least provide a shim/fallback for those.
Mark
Am Donnerstag, 31. März 2016 02:32:39 UTC+2 schrieb Justin Harrison:
>
> I would like to replace the default date widget in CakePHP3 with the HTML5
> da
I would like to replace the default date widget in CakePHP3 with the HTML5
date tag. I would have thought that was quite straight forward but have hit
a dead end each time.
Does anyone have any example code that works here?
Justin
--
Sign up for our Newsletter for updates.
http://cakephp.org
Jose,
It turns out that I AM MISTAKEN... The input field I was looking at was
defined as a "datetime".
However... The real issue is that the datetime input field is populated by
cake always as -mm-dd hh:mm:ss If it is a date object, it is
yyy-mm-dd. If I am in locale en-U
It is an unimplemented feature... Someone need to solve that issue of
showing time in a date column
On Friday, October 23, 2015 at 9:56:34 PM UTC+2, glk wrote:
>
> @JoseLorenzo
>
> The reason is that the cake $this->Form->input('date_field') always
> generates 3 i
@JoseLorenzo
The reason is that the cake $this->Form->input('date_field') always
generates 3 input fields. If the input uses type=text, the field is
populated with mm/dd/, hh:mm:ss
And all we should have is mm/dd/... of course it should also be LOCALE
format.
--
Like Us on FaceBook
Since I don't want to use 3 fields of input for a date, the idea of using a
text field with a datepicker seemed logical.
I've set :
//Config\USER_LOCALE = 'en_US'
I18n::locale( Config\USER_LOCALE );
Time::$defaultLocale = Config\USER_LOCALE;
So I'm
ndar->end_date are the only fields for which you use setters...
>>
>>>
>>>
> ok, solved ;)
> just format date in array data first to process it in patchEntity :
>
> if(isset($this->request->data['start_date']) &&
> trim($this->re
Il giorno mercoledì 2 settembre 2015 12:17:42 UTC+2, Anthony GRASSIOT ha
scritto:
>
> And that's normal and make sense because $calendar->start_date and
> $calendar->end_date are the only fields for which you use setters...
>
>>
>>
ok, solved ;)
just format
And that's normal and make sense because $calendar->start_date and
$calendar->end_date are the only fields for which you use setters...
Le 2 sept. 2015 12:07, "lorenzoshake" a écrit :
>
>
> Il giorno mercoledì 2 settembre 2015 11:24:15 UTC+2, Anthony GRASSIOT ha
> scritto:
>>
>> That what I thoug
Il giorno mercoledì 2 settembre 2015 11:24:15 UTC+2, Anthony GRASSIOT ha
scritto:
>
> That what I thought. Validation is not applied if you set the value
> directly with a setter like you does. You need to use patchEntity().
>
>
> i think so, but the other validation rules works fine!
--
Lik
x27;rule' => 'numeric'])
> ->allowEmpty('social_user_id')
> ->allowEmpty('name')
> ->allowEmpty('address')
> ->allowEmpty('city')
> ->add('lat', &
;lat', 'valid', ['rule' => 'numeric'])
->allowEmpty('lat')
->add('lng', 'valid', ['rule' => 'numeric'])
->allowEmpty('lng')
->add('start_
you use one of
>>> the proposed solution ?
>>>
>>> $value->gte raise errors ( is a query method); the strange think is that:
>>>
>>> ->add('end_date', [
>> 'valid'=> ['rule' => &
t;> this doesn't seems to be a correct syntax... Why don't you use one of the
>> proposed solution ?
>>
>> $value->gte raise errors ( is a query method); the strange think is that:
>>
>> ->add('end_date', [
> 'valid'
> $value->gte raise errors ( is a query method); the strange think is that:
>
> ->add('end_date', [
'valid'=> ['rule' => 'date'] ,
'compare' => [
'rule' => function
#x27;numeric'])
> ->allowEmpty('social_user_id')
> ->allowEmpty('name')
> ->allowEmpty('address')
> ->allowEmpty('city')
> ->add('lat', 'valid', [
d', 'valid', ['rule' => 'numeric'])
> ->allowEmpty('social_user_id')
> ->allowEmpty('name')
> ->allowEmpty('address')
> ->allowEmpty('city')
>
27;name')
->allowEmpty('address')
->allowEmpty('city')
->add('lat', 'valid', ['rule' => 'numeric'])
->allowEmpty('lat')
->add('lng', 'valid', [&
You can do like this.
->add('end_date', [
'mustValid'=>[
'rule'=>'checkForEndDate',
'provider'=>'table',
'message'=>__('End date
"lorenzoshake" a écrit :
> I've been tried with:
>
> $validator ->add('end_date', [
> 'valid'=> ['rule' => 'date'] ,
> 'compare' =>['rule' => ['comparison
I've been tried with:
$validator ->add('end_date', [
'valid'=> ['rule' => 'date'] ,
'compare' =>['rule' => ['comparison', '>' ,'start_date']]
Hi Gaurav,
Thank you for your answer. It did not work.
Best regards.
Paulo Terra
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscr
Try with this:
echo $this->Form->input(
'birthdate',
array (
'label'=> false,
'dateFormat' => 'DD-MM-YYYY',
'minYear
Hi,
I have been trying to change the date format from -MM-DD to DD-MM-
on a form at my site, but although I have changed the intl.default_locale
to pt_BR as it says on CakePHP 3.0 documentation is still the same format.
This is the view (add.ctp):
echo $this->Form->
Following my example and you answer in
https://groups.google.com/forum/?hl=es#!topic/cake-php/zUwDGhkMFO4 this
could be achieved like this:
combine(function($entity){return $entity->date->toDateString();}, 'id')
El sábado, 13 de junio de 2015, 8:17:56 (UTC+1), José
There are a few ways to accomplish this:
First one:
// ArticlesTable.php
public function _initializeSchema($schema) {
$schema->columnType('my_date_column', 'string');
}
That will remove all the converting back and forth for that specific
column. It will still be a da
It seems that the only way is to change column schema type from 'date' to
'string'.
Maybe could be a good idea to have a function to do such changes on an easy
way.
El miércoles, 13 de mayo de 2015, 21:33:08 (UTC+1), Aday Talavera escribió:
>
> First off, sorry fo
le trying to figure how to use combine with collections and entities
> (is in other thread) I didn't found an easy way to avoid date / datetime
> fields of DB been converted to Time instances.
>
> $query->hydrate(false);
>
> Didn't work, date / datetime field is also
First off, sorry for the "question spam". I'm just posting all issues of
the last two weeks in a short period of time. I hope that this isn't
disturbing anyone.
While trying to figure how to use combine with collections and entities (is
in other thread) I didn't found
Here's a pastebin <http://pastebin.com/E65nFXKx> (paid for it, might as
well use it).
It occurred to me there was something i hadn't tried. i've been using an
accessor function in the Entity to format the field to m/d/Y for screen.
Without it, i get the time (12:00 AM)
te:
>
> i found this topic here and on Stack Overflow:
> https://stackoverflow.com/questions/29336852/how-to-format-date-fields-before-save-in-cakephp-3
> The hash on the linked Doc page is no longer valid.
>
> Like the original post, i don't want to use the default select-b
i found this topic here and on Stack Overflow:
https://stackoverflow.com/questions/29336852/how-to-format-date-fields-before-save-in-cakephp-3
The hash on the linked Doc page is no longer valid.
Like the original post, i don't want to use the default select-based date
inputs. i'm for
I followed the instructions and it works. The problem is when I try to save
it to database (MySQL) where it expects date in '-mm-dd' format while I
set it to be displayed in 'dd/mm/yy' format in the form.
So, I insert codes to change the format as expected by mySQL in bef
veu:
>
> Read this:
>
>
> http://book.cakephp.org/3.0/en/orm/database-basics.html#parsing-localized-datetime-data
>
> On Thursday, April 2, 2015 at 6:10:58 PM UTC+2, Celso wrote:
>>
>> Hi guys I have a table in Mysql with a date field, and I need to allo
Read this:
http://book.cakephp.org/3.0/en/orm/database-basics.html#parsing-localized-datetime-data
On Thursday, April 2, 2015 at 6:10:58 PM UTC+2, Celso wrote:
>
> Hi guys I have a table in Mysql with a date field, and I need to allow my
> user writes something like *31/12/2015*.
&
Hi guys I have a table in Mysql with a date field, and I need to allow my
user writes something like *31/12/2015*.
echo $this->Form->input('data_nascimento', ['type' => 'text', 'maxlength'=>
'10']);
I've tried
Time::$de
---echo
>
> $this->Html->script(array('jquery',
> 'jquery-ui'));*4. Include the css file. Eq
>
>
>
>
>
> *//$project/app/views/Layouts/default.ctp
> -
Mark,
Thanks for the links to the tools. No, I hadn't searched for tools to
handle this but I was getting ready to. I need to go back to several more
projects before transferring them so this will be a help.
It amazes me how differently this problem (white space after closing tag)
can manifest
Hope you didnt have too many files to manually check.
You know that there are tons of tools for that, right?
E.g.
https://github.com/dereuromark/cakephp-tools/blob/master/Console/Command/PhpTagShell.php
or
https://github.com/dereuromark/cakephp-tools/blob/master/Console/Command/WhitespaceShell.p
Please, help.
I am new to CakePHP. I am using CakePHP 3.0. FormHelper makes me crasy. I
use following code:
echo $this->Form->month('expirationMonth');
echo $this->Form->year('expirationYear', [
'label' => '
mat(date(‘Y-m-d’), '-MM-dd', null,
$authuser['time_zone']); ?>
Using as below was affecting how datetimes are formatted inside views
AppController.php
public function beforeFilter(Event $event) {
….
$dateuser = Time::now();
$dateuser->
Hi Ken ..
Glad to hear that my hint helped it took a long time tracing through code
to find it, as it sounds like you had a similar issue, but related to white
space - it's very difficult to spot the real issue,as you just get
blackholed, with no indication why .. Now that the issue has been
docume
Your format looks incorrect, as you're not using date() compatible format
values.
-mark
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP&
It wasn't a call to pr() or an echo. It was whitespace following a closing
PHP tag. I just went through every file and got rid of every closing PHP
tag. Should have done it a long time ago.
I only have myself to blame. :-o
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twit
Thanks, I will do that.
Ken
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, se
Im trying to pass a logged in user current date with timezone offset in ‘Y-m-d’
format from controller to view in CakePHP 3.0.
Somehow date format becomes datetime format once in the view.
AppController.php - beforeFilter
$dateuser = Time::now();
$dateuser
Hi Ken ..
You may be having the same issue that I had .. you replied to my post as
well .. I found out that cake checks for any header (or debug/echo) being
sent before the session starts will cause the session not to start your
addition of the Cakesession::Start just forces the session start
I have found a work-around for this problem.
I found that Sessions were not being started (on redirect after Auth login)
on the server that had PHP 5.4.36 and Cake 2.x. My first work-around was to
set session.auto_start=1 in my php.ini file. The Sessions and Auth login
worked properly then.
I
Euromark,
Thanks for your response. I updated my version of CakePHP to the 2.6.1. Now
I can change the setup so that session cookies on the server are written to
/app/tmp/sessions. I now see the cookies - each with a name like
sess_abd5g143. The client-side cookie content is the GUID that m
You must have some special session setup.
For no one else this happens - ever.
Try to set up a completely fresh system and debug that one piece by piece.
If that happens there too its most likely a server issue.
Otherwise it is probably a misconfiguration in your configs in CakePHP etc.
mark
A
A kind person on IRC suggested that the problem might be fixed by going to
the latest version of Cake. So I updated to 2.6.1 and the problem still
exists.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message becaus
Another factor that might have a bearing on this: the old server had PHP
5.2.17 - the new server has 5.4.36.
In my original post I said I had a CakePHP 2.3 and a 1.3 app that were
misbehaving. When I switched the 1.3 app to use Session.default='cake', it
started working. Now I can switch it bac
I have tried changing the Session settings in core.php. I have tried both
Configure::write('Session', array('defaults' => 'cake')); and 'database'.
Each time I do that my error.log fills up with repeated errors that begin:
2015-01-18 17:15:13 Error: [CakeSessionException] Unable to configure the
First let me say I have looked for answers to this on this forum and in the
Book but nothing seems to fit. I have also posted this question on
StackOverflow and I apologize if any one is offended by my posting it both
places.
I have 3 working apps that I am moving from one production server t
Answer is here: https://github.com/cakephp/cakephp/issues/5611
Am Donnerstag, 8. Januar 2015 21:54:34 UTC+1 schrieb Lorne Dudley:
>
> I have a "baked" cakePHP-3.0.0 page which has a field defined as
> 'date_of_birth date DEFAULT NULL' in TABLE users.
> When
I have a "baked" cakePHP-3.0.0 page which has a field defined as
'date_of_birth date DEFAULT NULL' in TABLE users.
When I click the Submit for the "add" function I get
Warning (2): preg_match() expects parameter 2 to be string, array given
[CORE\src\Valid
/**
* Actions Model
*/
class ActionsTable extends Table {
public function validationDefault(Validator $validator) {
$validator->add('close_date', 'valid', ['rule' => 'date']);
}
..
data passed on save for close_date field :
[
Thank you Florin Trifu for your answer, it saved a lot of time..
I made some changes to script to include date format to hope that helps
someone else
$(function() {
$(".datepicker").datepicker(
{
dateFormat:
The solution was:
echo $contact->date->format('Y-m-d');
http://stackoverflow.com/questions/26561226/cakephp-3-displaying-date-without-time/26561331#26561331
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You recei
Hi,
On CakePHP 3 I have a database field which is a DATE (not DATETIME nor
TIMESTAMP)
When I display
echo $contact->date;
It will show something like 2014. 01. 06. 0:00. How to hide hours and
minutes?
I tried
print $this->Time->format($history->date, 'Y-m-d');
but
In the most simple example I can think of, for something like this:
*http://www.mysite.com/lessons/dashboard4/2014-09-01
<http://www.mysite.com/lessons/dashboard4/2014-09-01>*
$this->Html->link('title', array('controller' => 'lessons', 'action
Hi,
How do I pass the date field below entered as a parameter so I can search
the date?
echo $this->Form->input(
'custom date',
array(
'type' => 'date',
'selected' => array(
'year'=>date(
all easily possible:
>
> http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html#datetime-options
>
>
> Am Mittwoch, 17. September 2014 15:48:31 UTC+2 schrieb Jipson Thomas:
>>
>> Hi ,
>> Is there any option with the date input to change the display order. For
According to the docs this is all easily possible:
http://book.cakephp.org/3.0/en/core-libraries/helpers/form.html#datetime-options
Am Mittwoch, 17. September 2014 15:48:31 UTC+2 schrieb Jipson Thomas:
>
> Hi ,
> Is there any option with the date input to change the display order. For
Hi ,
Is there any option with the date input to change the display order. For
example now following code is generating two select box first one with the
year and second one with the month name. Actually for my project we require
to show the month select option first and then the year select box
Hi,
Would you please let me know how I can set the expiry date field using form
date input in cakephp 3 with a validation that it should be a future date.
My code written on template s as follows.
echo $this->Form->input('expiry_date', [
'label' =>
n't
> restricted by options, and I was just wondering, what's the best
> way to handle year parts of a date type using text/number input fields? For
> example, using `$this->Form->number('my_date.year')` in my add/insert view
> works because CakePHP parses t
Hi Folks,
I'm using text/number fields to let users input year values that aren't
restricted by options, and I was just wondering, what's the best
way to handle year parts of a date type using text/number input fields? For
example, using `$this->Form->number('my_dat
Thank you Mark. It is working.
Regards,
Jipson
On Monday, 11 August 2014 13:14:37 UTC+1, mark_story wrote:
>
> You should be able to set day => false in the options to turn off the day
> input.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
You should be able to set day => false in the options to turn off the day input.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe f
Hi,
Is there any option to use the form input type date for the credit card
expiry date. I mean we just need the year and month inputs only not the
day. I used the following but still I am getting the full date as
2014-August-7
echo $this->Form->date('exp
Stephen, thank you SO MUCH.
If anybody need to do something similar, this is the code:
if ($this->request->is('post')) {
$date = $this->request->data['BookedSurvey']['survey_date'];
$formattedDate = CakeTime::format
Check out
http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#TimeHelper::format
You can pass your date and specify which date format you want (see
http://www.php.net/date), so something like
$date = $this->request->data['BookedSurvey']['survey_date'];
Thank you very much Stephen. I only have a noob question... How can I tell
to my Form to send the date in that format?
This is the code of the button that I have in my view:
echo $this->Form->input('BookedSurvey.survey_date', array(
e a little off maybe, I haven't
had time to test.
$isBooked = $this->Point->BookedSurvey->find('count', array(
> 'conditions' => CakeTime::dayAsSql('Jul 23, 2014', 'survey_date') //
> replace the date as you see fit, using Jul 23,
'conditions' => array(
$this->Time->dayAsSql('BookedSurvey.survey_date') =>
date('Y-m-d') // Maybe pass an actual specific date rather than just today
)
));
echo &q
You could try something like the following
$isBooked = $this->Point->BookedSurvey->find('count', array(
'conditions' => array(
'BookedSurvey.survey_date' => date('Y-m-d') // Maybe pass an actual
specific date rather than just
already a survey for that date, an
error will be shown.
I have the following tables: places, points, users and booked_surveys.
The table booked_surveys has the following fields: id, survey_date,
point_id and user_id
Models: Place, Point, User, BookedSurvey
Controllers: PlacesController, Point
d_surveys;* and inside of booked_surveys you can find
the fields id (INT AUTO INCREMENT), survey_date (datetime), point_id (int)
and user_id (int).
The views are: add, edit, remove, index for each one
When viewing a point, an user can select a date and press "Book survey".
This is part
Thanks :)
On Wednesday, July 16, 2014 1:45:10 PM UTC+2, Thomas von Hassel wrote:
>
> yep, that was that plan :)
>
> /thomas
>
>
> ps: kudos to you all, 3.x is looking to be an awesome update and it has
> made my work fun again :)
>
>
>
> On 16 Jul 2014, at 13:41, mark_story wrote:
>
> > I am
yep, that was that plan :)
/thomas
ps: kudos to you all, 3.x is looking to be an awesome update and it has made my
work fun again :)
On 16 Jul 2014, at 13:41, mark_story wrote:
> I am assuming you have already implemented a custom form widget. You might
> also want to try replacing the Da
I am assuming you have already implemented a custom form widget. You might also
want to try replacing the Datetime type in the database layer. The type system
has hooks for marshalling data from a request in php form, which would be a
good place to set your locales format.
-mark
--
Like Us on
On 15 Jul 2014, at 17:35, José Lorenzo wrote:
>
> If you send a string that can be parsed by DateTime() it should just work
>
> On Tuesday, July 15, 2014 3:43:23 PM UTC+2, Thomas von Hassel wrote:
>>
>> Hi
>>
>> Ok, date time fields in 3.x are kicking my ass
:43:23 PM UTC+2, Thomas von Hassel wrote:
> Hi
>
> Ok, date time fields in 3.x are kicking my ass a bit, because i don't want to
> use the builtin dateTime widget, but just a text field with a javascript date
> picker.
>
> Now, when the post data is marshalled, is
If you send a string that can be parsed by DateTime() it should just work
On Tuesday, July 15, 2014 3:43:23 PM UTC+2, Thomas von Hassel wrote:
>
> Hi
>
> Ok, date time fields in 3.x are kicking my ass a bit, because i don’t want
> to use the builtin dateTime widget, but just a te
Hi
Ok, date time fields in 3.x are kicking my ass a bit, because i don't want to
use the builtin dateTime widget, but just a text field with a javascript date
picker.
Now, when the post data is marshalled, is there a good place to configure how a
date/time string is parsed to the Dat
Hi all, i'm new learner for cake.php
i'm trying to import my excel-CSV data to ms sql database thro the
controller.php
but one of my data in excel-CSV which is DATE display in this format (Mon,
21 May 2014)
how to convert this format (Mon, 21 May 2014) to 21-05-2014 by ignore the
mon?
You can also do a afterfind to convert the date to your format and then a
beforesave to convert the date back to mysql format.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the
Thank you for replying.
I was afraid that was the case... I will build a small helper to do that.
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
"CakePHP" g
I´ve solved this type of issues with a hidden field having the value in sql
format (-MM-DD ) and formatting the date for user with php in the text
field. ( http://php.net/manual/en/function.date.php )
jquery can set 2 fields with the diferents formats. (
http://jqueryui.com/datepicker/#alt
the field with:
echo $this->Form->input('date_start', array(
'type' => 'text',
'class' =>'datepicker',
'size' => 10
));
Before I start writing an Helper (that perhaps gener
gt; 'jquery-ui'));*4. Include the css file. Eq
>
>
>
>
>
> *//$project/app/views/Layouts/default.ctp
> -echo
> $this->Html->css('jquery-ui.css');*5. Put this lines of code before
> calling the date-pic
Okay, that's totally clear to me now. At first sight, I thought there
shouldn't be a "date modified" when adding a record. But that's the second
system that do save a "date create" and a "date modified" when adding a
record. Thanks 4 the
9. Februar 2014 15:46:34 UTC+1 schrieb Sam Clauw:
>
> Normally, when you add a record with a form to a database table, CakePHP
> will automatically fill in the "created" field in de database with the
> current date & time. It works for my table called "attractions"
Normally, when you add a record with a form to a database table, CakePHP
will automatically fill in the "created" field in de database with the
current date & time. It works for my table called "attractions" (model
"Attraction").
But now, strange things are
app and Im having issues with "Users" setting birthdates to
> 2013-12-13 as an example. I know I should have a validator to make sure it
> isnt a future date but is there a way to seed the start year say 4 years
> ago?
>
--
Like Us on FaceBook https://www.face
Hey everyone quick question.
I have an app and Im having issues with "Users" setting birthdates to
2013-12-13 as an example. I know I should have a validator to make sure it
isnt a future date but is there a way to seed the start year say 4 years
ago?
--
Like Us on Face
709.800.0852
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of baur79
Sent: Friday, July 26, 2013 4:32 PM
To: cake-php@googlegroups.com
Subject: Re: advanced route with date
please any hints
четверг, 25 июля 2013 г., 0:03:11 UTC+6 пользователь baur79 написал:
please any hints
четверг, 25 июля 2013 г., 0:03:11 UTC+6 пользователь baur79 написал:
>
> Hi,
>
> how to route
>
> /valutas/archive/2013/07/24/usd
> /valutas/archive/2013/07/24/eur
> /valutas/archive/2013/07/24
> Router::connect('/valutas/archive/:year/:month/:day/:code',
> array('controller' =>
Hi,
how to route
/valutas/archive/2013/07/24/usd
/valutas/archive/2013/07/24/eur
/valutas/archive/2013/07/24
Router::connect('/valutas/archive/:year/:month/:day/:code',
array('controller' => 'valutas', 'action' => 'archiveByday'));
/valutas/archive/2013/07/usd
/valutas/archive/2013/07/eur
/val
1 - 100 of 668 matches
Mail list logo