Can anyone tell me why this bit of code doesn't create an entry into localstorage?
myLocalStore.load();
var now = new Date();
var cardId = (now.getTime()).toString() + (this.getRandomInt(0, 100)).toString();
var entry1 = { id: cardId, dateCreated: now, title: 'The Title', narrative: 'the Text' };
var newRecord = new PinYin.model.Default(entry1);
myLocalStore.add(newRecord);
myLocalStore.sync();
console.log(entry1);
The console outputs
Object{id: "136575772251069", dateCreated: Fri Apr 12 2013 17:08:42 GMT+0800 (Taipei Standard Time), title: "The Title", narrative: "the Text"}
which is the correct format so im not sure what I'm doing wrong...
if I replace myLocalStore.add(entry1); with myLocalStore.add('value');
then i'll get the following inputted into the local storage
{"id":"ext-record-1","dateCreated":null,"title":null,"narrative":null}