Something that should be so simple, has been driving me nuts in Knockoutjs. Just to split an incoming string.
I have opts.value() from the calendar coming in and want to split it to remove the time, but it keeps returning "not a function". and doesn't like .split. Any ideas?
self.ShortDate = ko.computed(function () {
return self.opts.value().split(" ",4);
}, self);
Here is the string that is returned by opts.value "Wed Oct 14 2015 00:00:00 GMT+1300 (New Zealand Standard Time)"
Sorry for not including the VM, here is the relevant part from the https://github.com/MakerStudios/ko-calendar
self.opts = {
value: ko.observable(),
DateFromIn: ko.observable(),
current: new Date(),
deselectable: true,
showCalendar: true,
showToday: true,
showTime: false,
showNow: false,
militaryTime: false,
min: null,
max: null,
autoclose: false,