开发者

Date formatting on Action/Object publishing

With the new Action/Object parts of Open Graph, I'm trying to publish a DateTime formatted absolutely, something like:

"Dave is attending EventName on ... 9/28/2011 at 9:30pm"

However, I can only get the date to render in two formats: "123456789" or 开发者_运维问答"3 hours left".

I have created an Object, called Event. I've given it a custom field Time of type DateTime. I have created an Action, called Attend, which is associated with an event.

On the Event's page, I'm writing the meta tag using the Event's time in the same format as php time().

In both the Aggregation and the Action, I am trying to output "{event.time}" in the correct format. Based on the Formatter section of this page of FB's documentation, I'd think that I could specific a specific date formatter, like date(“F d, Y”). However, I always get an error like "Invalid format date(“F d, Y”)".

Any ideas how to get proper date formatting? Thanks!


The closest you can get is {event.time | date("fb_absolute")}. This is done to keep consistency with other dates on Facebook.


I've reported this as a bug https://developers.facebook.com/bugs/198438833569505

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜