views:

49

answers:

1

How can I alert the selected day into a format like 1,2,3,4,...,31. I.E. 12.10.2009 should alert 12.

A: 

what about a simple substring?

var day = dateFromDatePicker.substr(0, dateFromDatePicker.indexOf("."));
alert(day);

edit: my bad, you need to say from 0 to first index of "."

peirix
thx for feedbackfunction pickedDate(value, date, inst) { var day = value.substr(value.indexOf(".")); alert(day); }alerts only:.11.2009The day is still missing.
my bad. fixed now (:
peirix
thx a lot... worksmeanwhile you gave me a kickstart with string manipulations:var b = value;var temp = new Array();temp = b.split('.');alert(temp[0]);
Yup, and that way might actually be better for you, in case you want to pull out month and year as well. You could simply do: `var month = temp[1]; var year = temp[2];`
peirix