我在按日期过滤时使用另一种不同的格式时出错。
我从类型为 Edm.DateTimeOffset
的服务层中BusinessPartners的日期字段 CreateDate 中完美过滤。<Property Name="CreateDate" Type="Edm.DateTimeOffset"/>
控制器
onSearch: function(oEvent) {
var oFilterModel = this.getView().getModel("filters");
var sDate= oFilterModel.getProperty("/datefrom");
var sDate2 = oFilterModel.getProperty("/dateto");
if(date) {
// formatear fecha
var oDateFormat = sap.ui.core.format.DateFormat.getInstance({
pattern : "yyyy-dd-MM"
});
var from= oDateFormat.format(new Date(sDate));
var to= oDateFormat.format(new Date(sDate2));
aFilters.push( new sap.ui.model.Filter("CreateDate", sap.ui.model.FilterOperator.BT, "'"+from+"'", "'"+to+"'") );
}
}
查看
<DateRangeSelection
placeholder="Select ..."
dateValue="{path:'filters>/datefrom'}"
secondDateValue="{path:'filters>/dateto'}"
/>
hasPendingChangesForPath中的错误-错误:不支持的类型: Edm.DateTime ...... ... ... 在Array.map()sap.ui.model.odata.v4.ODataBinding
现在,当我连接到另一个数据库时,日期字段 CreateDate 的类型为Edm.DateTime
<Property Name="CreateDate" Type="Edm.DateTime"/>
我收到以下错误
hasPendingChangesForPath中的错误-错误:不支持的类型: 约会时间 在Object.formatLiteral(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:3691:2877) 在r(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:3427:77) 评估时(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:3427:1242) 评估时(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:253:173) 在c(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:248:99) 在新的S(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:250:773) 在S.then(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:253:151) 在t(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:3427:875) 评估时(https://sapui5.netweaver.ondemand.com/resources/sap/ui/core/library-preload.js?eval:3427:748) 在Array.map()sap.ui.model.odata.v4.ODataBinding