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
2009-09-04 11:14:13
thx for feedbackfunction pickedDate(value, date, inst) { var day = value.substr(value.indexOf(".")); alert(day); }alerts only:.11.2009The day is still missing.
2009-09-04 11:20:53
my bad. fixed now (:
peirix
2009-09-04 11:26:15
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]);
2009-09-04 11:29:42
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
2009-09-04 11:43:11