SAP UI5应用里类型为Edm.DateTime的日期控件设计原理

简介: SAP UI5应用里类型为Edm.DateTime的日期控件设计原理

Recently I was struggled with a customer incident and finally I realized that I didn’t understand the Edm.DateTime quite clearly. So I spend some time to do research on it to fix my knowledge gap. I list my learning here in case any other guy needs it as well.

For my study, I use this field in my application for example.

image.pngimage.pngimage.pngimage.pngWhy is there difference between them?

And when I type “alert(new Date(1443830400000));” in chrome console, I get this popuimage.pngActually it ( 2015-10-03 08:00:00 GMT +0800 ) points to exactly the same time as 2015-10-03 00:00:00 UTC.


So how could the date with format /Date(1443830400000)/ be consumed in my application?


It makes sense to start debugging via the framework handler when the response of odata request ( Opportunity re-read after closing date is changed ) is successfully returned:

image.pngThe aim is to figure out how framework parses this /Date(1443744000000)/.

Then I reached the place:


(1) there is a regular expression which extracts the number 1443744000000 from the input string.


(2) a local time is returned by new Date(), with the number parsed by previous step passed in. The local time is returned based on current Time zone configured in my laptop.

image.pngThen the local time returned by framework will be passed into my formatter so now I could do any formatting based on customer requirement:


[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-V7xzygvx-1596956679633)(https://upload-images.jianshu.io/upload_images/2085791-bfe738ad92f3cb66.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)]


相关文章
|
29天前
|
前端开发 编解码 数据格式
浅谈响应式编程在企业级前端应用 UI 开发中的实践
浅谈响应式编程在企业级前端应用 UI 开发中的实践
22 0
浅谈响应式编程在企业级前端应用 UI 开发中的实践
|
2月前
|
前端开发 搜索推荐 开发者
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
SAP UI5 sap.m.Column 控件的 minScreenWidth 属性介绍
29 0
|
2月前
|
JavaScript 前端开发 开发者
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
SAP UI5 控件 sap.m.ListBase 的 inset 属性的作用介绍
17 0
|
2月前
|
Web App开发 数据采集 前端开发
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
纯技术讨论:如何让 SAP UI5 应用无法被别人在浏览器里调试 - 这种做法不推荐试读版
15 0
|
3天前
|
前端开发 搜索推荐 UED
【Flutter前端技术开发专栏】Flutter中的高级UI组件应用
【4月更文挑战第30天】探索Flutter的高级UI组件,如`TabBar`、`Drawer`、`BottomSheet`,提升应用体验和美观度。使用高级组件能节省开发时间,提供内置交互逻辑和优秀视觉效果。示例代码展示了如何实现底部导航栏、侧边导航和底部弹出菜单。同时,自定义组件允许个性化设计和功能扩展,但也带来性能优化和维护挑战。参考Flutter官方文档和教程,深入学习并有效利用这些组件。
【Flutter前端技术开发专栏】Flutter中的高级UI组件应用
|
9天前
|
机器学习/深度学习 人工智能 自然语言处理
【AI大模型应用开发】3.2 RAG实战 - RAG应用+UI实现加载本地文件并对话
【AI大模型应用开发】3.2 RAG实战 - RAG应用+UI实现加载本地文件并对话
25 0
|
25天前
关于 SAP ABAP OData 服务如何实现 Deep Insert 场景 - SAP 应用的标准行为试读版
关于 SAP ABAP OData 服务如何实现 Deep Insert 场景 - SAP 应用的标准行为试读版
16 1
|
2月前
|
开发者 UED
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
关于 SAP UI5 sap.m.Column 的 demandPopin 属性
15 0
|
2月前
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
SAP UI5 Link 控件的使用方法介绍 - 后续学习 Fiori Elements Smart Link 的基础试读版
15 0
|
2月前
|
XML 存储 数据格式
SAP UI5 控件 customData 属性的应用介绍
SAP UI5 控件 customData 属性的应用介绍
33 0