Mailing List Archive

[Bricolage-General] a little more date formatting
All,

I'm looking to do date formatting on a different value, like I was doing in
an email I sent a couple days ago. Anyway, in a different template I'm
getting a list of stories like this:

my @stories = Bric::Biz::Asset::Business::Story->list({'category_id' =>
$cat_id, 'publish_status' => 1, 'Order' => 'slug' });

and then with one of those stories, i get the publication date:

my $formatted_date;
if (my $pubdate = $story->get_data('publication_date', 1, "%B %Y")) {
$formatted_date = $pubdate;
}

and this seems to ignore the date/time format string i'm passing. Calling
get_data in this manner, it returns the date with the standard formatting,
without the middle argument, it returns nothing, and then without the 2nd or
3rd, it again returns the date w/ the standard format. Is there some
get_data() function that wasn't updated to have this functionality?

Thanks,
Phil


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general
Re: [Bricolage-General] a little more date formatting [ In reply to ]
On Friday, September 27, 2002, at 02:23 PM, Philip Fibiger wrote:

> my $formatted_date;
> if (my $pubdate = $story->get_data('publication_date', 1, "%B %Y"))
> {
> $formatted_date = $pubdate;
> }
>
> and this seems to ignore the date/time format string i'm passing.
> Calling
> get_data in this manner, it returns the date with the standard
> formatting,
> without the middle argument, it returns nothing, and then without the
> 2nd or
> 3rd, it again returns the date w/ the standard format. Is there some
> get_data() function that wasn't updated to have this functionality?

Ah, crap, you would send this right after I've released 1.4.2. I'll
patch it to take the third argument, but in the meantime you can use
this workaround:

my $pub_date = $story->get_tile->get_data('publication_date', 1, "%B
%Y");

HTH,

David

--
David Wheeler AIM: dwTheory
david@wheeler.net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory@jabber.org



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general