A nice datepicker has been added to the module here #1281406: Provide a datepicker widget for the birthday filed., is there some configuration of the datepicker available? When i use the datepicker now the first day of the week is Sunday, is possible to change that? I've installed the Date module and when i use it in other fields the first day of the week is Monday as i configured. Is there any relation in the configuration of date formats between these two modules? If not, would be posible to configure the datepicker for Birthday module in some way?

CommentFileSizeAuthor
#10 dateformat-1306432.patch6.74 KBafeijo

Comments

Niklas Fiekas’s picture

Title: Datepicker configuration » Datepicker widget ignores first week day setting of Drupal core
Category: support » bug

Thanks for reporting this problem, betoscopio. Drupal core has a setting for the first weekday and Birthdays module should respect it.

Niklas Fiekas’s picture

The jQuery setting is firstDay.
I need to figure out what's the best way to pass
variable_get('date_first_day', 0); to the JavaScript layer.

andypost’s picture

Suppose you could add settings to widget via #attached code

FAPI docs

$settings = array('firstDay' => variable_get('date_first_day', 0););
$element['value']['#attached']['js'][] = array(
  'data' => array('birthdays' => $settings),
  'type' => 'setting',
);
Niklas Fiekas’s picture

@andypost: Thanks :)

betoscopio’s picture

This seems promising, thanks for your great work.

afeijo’s picture

I added the code to the widget #attach, and to the birthdays.js file

but it had no effect

I will debug it a bit more, and post my patch tomorrow. The patch includes my changes to my other open issue tho

Niklas Fiekas’s picture

Status: Active » Fixed

I completed this now, because it was annoying me: http://drupalcode.org/project/birthdays.git/commitdiff/8c6eb550abe8824cf....

@afeijo: To do it i took the matching hunk from your patch at #1306432: Datepicker widget should respect drupal date mask and did what was left (thus the author attribution). I realize that this breaks your patch there. You can submit your patch against the HEAD you started with, if you want - I was impacient - I can do the merge ;)

afeijo’s picture

I've been looking for you in IRC, I saw that you asked Druplicon about me too, lol

I had to simplify my cod to return in a specific format to fit my imediately needs (birthdays_birthday.inc: reduceDateFormat() )

I will improve it when I can, or if you would, I appreciate. But I have a problem, since you commited changes to the project, I had to commit locally so I could pull from git server. Now I'm not sure how to generate the patch bcs git diff return nothing! :/

Niklas Fiekas’s picture

:D

Yep.

I realize that this breaks your patch there. You can submit your patch against the HEAD you started with, if you want - I was impacient - I can do the merge ;)

Since you comitted it locally, please try:

git pull --rebase origin 7.x-1.x
git diff HEAD~1 HEAD

If that doesn't work maybe I have a wrong idea of the state your repo is in. You could push it up to a sandbox or github or something and I could merge from there.

afeijo’s picture

StatusFileSize
new6.74 KB

Great, I think I've got it. Thanks

Check the attach

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.