I’m experimenting with the new output=JSON capabilities of Domino in R7 and R8. This is working great but I’m having one problem: I can’t figure out how to reference a datetime object:
entrydata: [
{
“@columnnumber”: 0,
“@name”: ‘WTWeekEnding’,
datetime: {
0: ‘20070401’
}
This code works great if the value is text:
for (var i = 0; i < ntrydata.entrydata.length; i++) {
if(ntrydata.entrydata[i]["@name"] == name) {
retval = ntrydata.entrydata[i].text[0]
}
I’ve tried using .value and .toString without luck. I’d love to create a Date object but I still can’t figure out how to set it to this value. Any help would be appreciated.
I don’t know if this is the most efficient way, but what I have done is a test for if text is there, else if datetime, elseif number, etc. Something like below:
for (var i = 0; i < ntrydata.entrydata.length; i++) {
When you use ?readViewEntries&outputformat=JSON the view info is going to come back either as text, datetime, or number depending on how you format the view column, so I test for each possibility.
Subject: RE: Referencing JSON DateTime object in JS
Thank you sooooo much Michelle, that worked. I’m assuming that the same is true with Numbers? Also, that I’ll have to rebuild the date myself? Thanks again!