Re: Site wide date format

2008-07-16 Thread web-junkie

Wouldn't it be useful to use that setting as a default for the date
filter, so you wouldn't need to specify a format every time?
I could write a patch..

On 15 Jul., 15:31, Arien <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote:
>
> > I'm looking for a consistent way to format dates across my site,
> > without having to put the format into every template.  Is it possible
> > to set a default date format for the "date" filter?  For example, I
> > want {{ var.date|date }} to format to {{ var.date|date:"l, F j Y" }}
> > unless I specify otherwise, but still have the ability to format it
> > differently in some cases.  Is this possible?
>
> Use the DATE_FORMAT 
> setting:http://www.djangoproject.com/documentation/settings/#date-format
>
> Arien
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Site wide date format

2008-07-15 Thread Adam Peacock

Thank you for the quick response - I think I'm going to go with the
custom filter for maximum flexability

On Jul 15, 9:25 am, "Brett Hoerner" <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote:
> >  Is this possible?
>
> Not with the current date filter.  You could make your own templatetag
> that just wraps the existing one, though.
>
> http://www.djangoproject.com/documentation/templates_python/#writing-...
>
> Brett
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Site wide date format

2008-07-15 Thread Arien

On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote:
>
> I'm looking for a consistent way to format dates across my site,
> without having to put the format into every template.  Is it possible
> to set a default date format for the "date" filter?  For example, I
> want {{ var.date|date }} to format to {{ var.date|date:"l, F j Y" }}
> unless I specify otherwise, but still have the ability to format it
> differently in some cases.  Is this possible?

Use the DATE_FORMAT setting:
http://www.djangoproject.com/documentation/settings/#date-format


Arien

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Site wide date format

2008-07-15 Thread Brett Hoerner

On Tue, Jul 15, 2008 at 8:14 AM, Adam Peacock <[EMAIL PROTECTED]> wrote:
>  Is this possible?

Not with the current date filter.  You could make your own templatetag
that just wraps the existing one, though.

http://www.djangoproject.com/documentation/templates_python/#writing-custom-template-tags

Brett

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Site wide date format

2008-07-15 Thread Adam Peacock

I'm looking for a consistent way to format dates across my site,
without having to put the format into every template.  Is it possible
to set a default date format for the "date" filter?  For example, I
want {{ var.date|date }} to format to {{ var.date|date:"l, F j Y" }}
unless I specify otherwise, but still have the ability to format it
differently in some cases.  Is this possible?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---