slaFFik/BP-GTM-System

Datepicker missing

Closed this issue · 4 comments

Hello. I have problem with Deadline for projects. The datepicker is missing in Project deadline in the "create new project" page so I can't choose the date and it always in the past (January 1 1970) which means i can't do nothing (such as creating tasks).

Screen-shot: http://www.2shared.com/photo/iES2R4Bk/dp_online.html

WP: 3.4.1.
BP: tried 1.5.3.1 (Hebrew Localized) & 1.6.1,
Theme: Using both the default BP theme and custom one.
GTM: I used BP GTM System 1.9.5, and tried to git clone to 1.9.6 but it didn't solved my problem.

I can see the datepicker (just next/prev icons are missing here) and I can confirm the date is always set to January 1 1970 for me too.
You're using an Hebrew Localized install and I'm using an italian localized install, this lead me to think the problem is with some localization support, so I've found the problem with the date in the past is present only when WP_LANG is not default.... I'm going to have a look at the code here too...

workarounded the problem changing WP date settings in Settings -> General

my dates where set to a custom "j F Y" format which is the most humanized italian date format (eg: 29 ottobre 2012) but we use also "d/m/Y" (eg: 29/11/2012), which is what I've changed to and just works fine with GTM.

Looking at bp-gtm-cssjs.php the supported dates locale are as follows:

    $dates = array(
        'F j, Y' => 'MM d, yy',
        'Y/m/d'  => 'yy/mm/dd',
        'm/d/Y'  => 'mm/dd/yy',
        'd/m/Y'  => 'dd/mm/yy',
        'd.m.Y'  => 'dd.mm.yy'
    );

maybe I can come with a patch to separate human readable dates format from machine parsable using jQueryUI altfield/altformat feature .... stay tuned

committed on my fork, pull request sent to slaFFik!

Merged.