SharePoint リストにアクセスして、作成したカスタム Web パーツのカレンダーの日付を返そうとしています。正常に機能していたので、カレンダー全体ではなく、選択した日付のみを取得することにしたので、where 句を追加したいと考えました。
「yyyy-MM-dd」、「yyyy-MM-ddThh:mm:ssZ」、および「yyyy-MM-dd hh:mm:ssZ」を文字列形式として試しました。また、MM/dd/yyyy も試しました。日付形式として。
jQuery を使用していますが、カレンダーにリスト アイテムがあります。日付の形式が正しくないと思います。
var date = $(this).attr('date');
var sharepointDate = Date.parse(date).toString('yyyy-mm-ddT00:00:01Z');
var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>CorporateCalendar</listName> \
<viewFields> \
<ViewFields> \
<FieldRef Name='Title' /> \
</ViewFields> \
</viewFields> \
<query><Query><Where><Geq><FieldRef Name='EventDate' /><Value Type='DateTime'>" + sharepointDate + "</Value></Geq></Where></Query></query> \
<rowLimit>500</rowLimit> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";
where 句を削除すると、カレンダー内のすべてのアイテムが表示されます。クエリがそこにある場合、結果は返されません。
前もって感謝します
作業コード:
var sharepointDate = Date.parse(date).toString('yyyy-MM-dd');
var soapEnv =
"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
<soapenv:Body> \
<GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
<listName>CorporateCalendar</listName> \
<viewFields> \
<ViewFields> \
<FieldRef Name='Title' /> \
</ViewFields> \
</viewFields> \
<query><Query><Where><Eq><FieldRef Name='EventDate' /><Value Type='DateTime' IncludeTimeValue='False'>" + sharepointDate + "</Value></Eq></Where></Query></query>\
<rowLimit>1500</rowLimit> \
</GetListItems> \
</soapenv:Body> \
</soapenv:Envelope>";