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 G
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-
I was able to make this work without much of a problem using dates in the
format they arrive from the database.
But that's not an acceptable for the users... and here I started having
problems.
It's easy enough to set the dateFormat of the datepicker (as suggested in
posts I've seen around), bu
Hi
I have no idea how to change language display dates in forms, i have
default English, but how to change on language of operating system?
And second how display only year and month fields without day in form?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
OK, thank you for the information!
On Wed, Oct 20, 2010 at 9:17 AM, AD7six wrote:
>
>
> On Oct 20, 12:56 am, cricket wrote:
>> On Tue, Oct 19, 2010 at 6:02 AM, psybear83 wrote:
>> > Hi everybody
>>
>> > Is there a reason why CakePHP doesn't recognize dates before
>> > 1600-01-01? I get a valida
On Oct 20, 12:56 am, cricket wrote:
> On Tue, Oct 19, 2010 at 6:02 AM, psybear83 wrote:
> > Hi everybody
>
> > Is there a reason why CakePHP doesn't recognize dates before
> > 1600-01-01? I get a validation error when submitting a date before
> > that (e.g. 1599-31-12 or 1300-11-05).
>
> Use th
Wow... It seems I'm always asking for things I suppose have an easy
answer (but I'm too dumb to find them myself), and then it comes out
that nobody else really knows it as well... ;-)
Thanks for you explanations, cricket! I'm not using any dates in the
past at all in my application, but I stumble
On Tue, Oct 19, 2010 at 6:02 AM, psybear83 wrote:
> Hi everybody
>
> Is there a reason why CakePHP doesn't recognize dates before
> 1600-01-01? I get a validation error when submitting a date before
> that (e.g. 1599-31-12 or 1300-11-05).
Use the source, Luke.
http://api.cakephp.org/view_source/v
I'm using MySQL.
mysql --version Ver 14.12 Distrib 5.0.51a, for apple-darwin9.0.0b5
(i686) using readline 5.0
On Tue, Oct 19, 2010 at 3:30 PM, Chris Burch wrote:
> Sounds like a database issue. I know 1600-01-01 is Oracle's "first
> date".
>
> On Oct 19, 5:02 am, psybear83 wrote:
>> Hi everybod
Sounds like a database issue. I know 1600-01-01 is Oracle's "first
date".
On Oct 19, 5:02 am, psybear83 wrote:
> Hi everybody
>
> Is there a reason why CakePHP doesn't recognize dates before
> 1600-01-01? I get a validation error when submitting a date before
> that (e.g. 1599-31-12 or 1300-11-05
Hi everybody
Is there a reason why CakePHP doesn't recognize dates before
1600-01-01? I get a validation error when submitting a date before
that (e.g. 1599-31-12 or 1300-11-05).
Thanks,
Josh
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related q
Or you might just use PHP to do it:
echo date('l, d-m-Y', strtotime($this->data['Model']['date_field']));
Further reading:
http://php.net/manual/en/function.date.php
http://www.php.net/manual/en/function.strtotime.php
~wrdevos
On Sep 29, 4:50 pm, "Mike Karthauser" wrote:
> On Wed, September 29
On Wed, September 29, 2010 3:22 pm, james livsey wrote:
> yeah its a database field - just a regular date outputting 'September 29
> 2010' but i need to 'add' the day to that output - does that make sense?
>
> so if the outputted date is the above i need to work out that the day is a
> Wednesday.
yeah its a database field - just a regular date outputting 'September 29
2010' but i need to 'add' the day to that output - does that make sense?
so if the outputted date is the above i need to work out that the day is a
Wednesday.
Thanks for replying!
On Wed, Sep 29, 2010 at 3:19 PM, Tilen Maj
Time Helper u mean?
or u mean database fields? "created" and "modified" ("updated")
--
Tilen Majerle
http://majerle.eu
2010/9/29 james
> Hi,
>
> is there a cake way to work out the day from a date field?
>
> thanks
>
> Check out the new CakePHP Questions site http://cakeqs.org and help other
Hi,
is there a cake way to work out the day from a date field?
thanks
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this gro
Hello,
I'd like to have date fields that allow null values to default to a
null selection in the date/time menus when generating pages from the
admin scaffold. I found ticket 5702 that suggests a patch, but that's
for Cake 1.2, I wasn't able to work out a fix for 1.3. Has anyone
Hmm
I thought if you left out the field entirely that was the
straightforward fix.
$validate should only mention fields you want to validate
On Feb 11, 5:41 am, overture wrote:
> I am having issues with validation on date fields. I need to ignore
> validation for a date field, howe
I am having issues with validation on date fields. I need to ignore
validation for a date field, however, I have tried everything and
can't find a solution. I have changed the validation on the model
to:-
'actual_start_date' => array(
'rule'=>'date
Hi,
thanks for your reply. The data field was set to null before. If I
update a dataset and assigning the null value to a the birthday field
(SET birthday=null) it works fine. So I added the following code to my
controller:
if(empty($this->data['Employee']['birthday']))
$this->data['Emplo
On 16 dic, 11:44, Sebastian Göttschkes wrote:
> Additionally, if I add a valid birthday, it is saved correctly. When
> editing the employee, I would like to get the birthday viewed in the
> format dd.mm.. How can I tell cake to view the birthday like this?
Ok, here's what I've done:
in the
e
'null value' for a date field. I have the problem of dates that can be
full, or just years, or just years and months, so I can't use a date
field at all, and have to validate my dates otherwise.
Basically, to edit the date fields as you like, you have to process
them before saving
pe that helps. Be careful what format to validate!
Anja
-Ursprüngliche Nachricht-
Von: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] Im Auftrag
von Sebastian Göttschkes
Gesendet: Dienstag, 16. Dezember 2008 14:45
An: CakePHP
Betreff: cake 1.2 forms: date fields left empty
Sebastian Göttschkes wrote:
> Hi,
>
> i got the following problem using cakePHP 1.2 RC3:
>
> My Model 'Employee' has a attribute called 'birthday' (datatype:
> DATE). In the add-view, I have the following code:
> input('birthday',array('type'=>'text'));?>
> If i left this field blank when adding a
Hi,
i got the following problem using cakePHP 1.2 RC3:
My Model 'Employee' has a attribute called 'birthday' (datatype:
DATE). In the add-view, I have the following code:
input('birthday',array('type'=>'text'));?>
If i left this field blank when adding an employee, this employee has
the birthday
only thing i can say, is that villas and Dardo Sordi Bogado were right
there was no documentation on that, but now i know that it is better
to avoid such naming conflicts
anyway, if i ever publish a "cake Look-Out-list", this will definitly
be on it
i still do not know what xavier wanted to tel
I am still over looking the problem and then i will prepare a
statement and tell you my point.
On 11/10/2008, Mark (Germany) <[EMAIL PROTECTED]> wrote:
>
> @xavier:
> what exactly is your point? :)
>
>
> On 10 Nov., 12:12, "Mark (Germany)" <[EMAIL PROTECTED]>
> wrote:
>> well, i sure could have r
@xavier:
what exactly is your point? :)
On 10 Nov., 12:12, "Mark (Germany)" <[EMAIL PROTECTED]>
wrote:
> well, i sure could have renamed it if i had known that it is a problem
> a) to name a field like the model
> b) to name it like a reserved word
>
> thx so far
>
> On 10 Nov., 02:11, "Xavier M
well, i sure could have renamed it if i had known that it is a problem
a) to name a field like the model
b) to name it like a reserved word
thx so far
On 10 Nov., 02:11, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
> What they said lol. If you find your self bugging with the date dont
> use it w
What they said lol. If you find your self bugging with the date dont
use it without debugging.
On 11/09/2008, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote:
>
> Avoid naming a field the same as the model and this will not happen ;)
>
> On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
> <[EMAIL PROTE
Avoid naming a field the same as the model and this will not happen ;)
On Sun, Nov 9, 2008 at 8:03 PM, Mark (Germany)
<[EMAIL PROTECTED]> wrote:
>
> As the pr() output shows, the processed form data on POST
> returns a devided array with the normal "Date" and a second "date"
> resulting in 2 warn
Having had a tough time in the past with this kind of problem, I
would instinctively try to avoid using typical reserved words such as
'date'. These kinds of issues are notoriously difficult to resolve,
and tend to crop up again later. I appreciate this is not an answer
to the question, but cou
As the pr() output shows, the processed form data on POST
returns a devided array with the normal "Date" and a second "date"
resulting in 2 warnings (Undefined variable: month/year) + the form
process recognized as invalide.
Array
(
[Date] => Array
(
[user_id] => 1
, the URL looks like this:
>
> >http://www.example.com/events/search?event_name=&location_name=&start...
>
> > Which makes it impossible to work out the date that was submitted
> > because the last query parameter overwrites the previous ones!
>
> > $this->pa
hat was submitted
> because the last query parameter overwrites the previous ones!
>
> $this->params['url']:
>
> [url] => events/search
> [start_date] => pm
>
> If I use 'post' as the form type, Cake separates the date fields
> correc
ery parameter overwrites the previous ones!
>
> $this->params['url']:
>
> [url] => events/search
> [start_date] => pm
>
> If I use 'post' as the form type, Cake separates the date fields
> correctly, but the search result
date that was submitted
because the last query parameter overwrites the previous ones!
$this->params['url']:
[url] => events/search
[start_date] => pm
If I use 'post' as the form type, Cake separates the date fields
correctly, but the search r
thanks for reply.
> try: $this->cleanUpFields('ListEvents') ;
This throws an Error cause my Model Name is 'ListEvent'. If i use my
model name, there's no effect on the date problem. I still need to do
it manually :/
On 16 Sep., 20:51, dardosordi <[EMAIL PROTECTED]> wrote:
> $this->cleanUpFields
$this->cleanUpFields() should work, if not you must put a ticket in
trac.cakephp.org .
On Sep 14, 4:05 pm, cronet <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> i get rid of simple things... (Things which worked already)... I could
> bang my head to the wall !!
> My first cake app, and i'm very impre
Hi there,
i get rid of simple things... (Things which worked already)... I could
bang my head to the wall !!
My first cake app, and i'm very impressed by cakephp.
Tow basic things won't work for me:
I think i'm doing all right, but the automagic of validating fields
and throwing an error won't
Hi All,
Probably a basic question, but I could not find anything in the
archives nor on google.
I am using scaffolding with a model that has some date fields in the
database. Using 1.1 it displayed a '-00-00' date in the db as an
'empty' date. But now, using 1.2, it per
42 matches
Mail list logo