Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using the JSON API plugin to display my blog posts on my mobile website. I've got everything working as I'd like, however the the date displays in this format:

 2012-03-21 20:03:30

However, I'd like it to display like so. Or something similar.:

 March 21, 2012

This is the Javascript I'm using to display the blog posts:

 var MYBLOG_LIMIT = 7;
    var MYWRAPPER_CLASS = 'homeblog';

    var WP={open:function(b){var a={posts:function(){var d=MYBLOG_LIMIT;var e=0;var c={all:function(g){var f=b+"/api/get_recent_posts/";f+="?count="+d+"&page="+e+"&callback=?";jQuery.getJSON(f,function(l){var k=l.posts;for(var j=0;j<k.length;j++){var h=k[j];h.createComment=function(i,m){i.postId=h.id;a.comments().create(i,m)}}g(k)})},findBySlug:function(f,h){var g=b+"/api/get_post/";g+="?slug="+f+"&callback=?";jQuery.getJSON(g,function(i){h(i.post)})},limit:function(f){d=f;return c},page:function(f){e=f;return c}};return c},pages:function(){var c={findBySlug:function(d,f){var e=b+"/api/get_page/";e+="?slug="+d+"&callback=?";jQuery.getJSON(e,function(g){f(g.page)})}};return c},categories:function(){var c={all:function(e){var d=b+"/api/get_category_index/";d+="?callback=?";jQuery.getJSON(d,function(f){e(f.categories)})}};return c},tags:function(){var c={all:function(e){var d=b+"/api/get_tag_index/";d+="?callback=?";jQuery.getJSON(d,function(f){e(f.tags)})}};return c},comments:function(){var c={create:function(f,e){var d=b+"/api/submit_comment/";d+="?post_id="+f.postId+"&name="+f.name+"&email="+f.email+"&content="+f.content+"&callback=?";jQuery.getJSON(d,function(g){e(g)})}};return c}};return a}};

var blog = WP.open('http://www.endofphotography.com/');

    blog.posts().all(function(posts){
        for(var i = 0; i < posts.length; i++){
            jQuery('.'+MYWRAPPER_CLASS).append(function(){
        return (posts[i].content) ? '<div class="lastpost_title" href="'+posts[i].url+'"><h4>'+posts[i].title+'</h4></div><div href="'+posts[i].url+'">'+posts[i].content+'<br>'+posts[i].date+'</div><br><hr><br>' : '<div href="'+posts[i].url+'"><h4>'+posts[i].date+'</h4></div>';
     });
   }
 });

I've scoured the web for an answer and Stack Overflow as well, but I believe the solution is going to be 'hacking' the plugin somehow.

Thanks in advance!

share|improve this question
1  
I voted to close this because time conversion is a PHP or JavaScript question. – Wyck Jul 27 '12 at 5:57
True, although the answer may well be specific to the Wordpress JSON API plugin. The mods can make the call. – Paul Jul 27 '12 at 13:00
Stackexchange doesn't work like that, anyone over a certain rep can vote to close/open questions, wordpress.stackexchange.com/privileges/close-questions – Wyck Jul 27 '12 at 16:05

closed as off topic by Wyck, kaiser, toscho Oct 3 '12 at 0:58

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

Browse other questions tagged or ask your own question.