SAP UI5的控制元件DatePicker的DateFormat屬性詳解
This blog contains my research about the date format determination for DatePicker control.
Suppose I have select a new date ( 2015-10-15 ) from DatePicker control, my aim is to figure out the logic how the line 192 has translated dateTapped, “Thu Oct 15 2015” to tempString, “15.10 2015”.
aFormatArray
When I debug into this method, I find an array this.aFormatArray.
It contains the date format placeholder as below: “day.month.year”. This is the reason why I get 15.10.2015 as conversion result.
So the question now is, when, where and how is this.aFormatArray populated? Do a text search and I find out it is determined by variable this.oFormatOptions.pattern. In my laptop it has value “dd.MM.yyyy”. Where does this pattern come from?
this.oFormatOptions.pattern
Through debugging we can know the pattern is determined by these three factors:
The pattern is stored in this.mCustomData in LocaleData.js:
this.mCustomData
And this.mCustomData is filled in LocalData.js ‘ constructor function:
getCustomLocaleData function just simply returns mSettings in Configuration.js:
mSettings
Now I will look into when the data in this.mSettings will be populated. I find an array M_ABAP_DATE_FORMAT_PATTERN which contains lots of date format options. For my current testing, the format option with key sFormatId = 1 is chosen. Why “1”?
This “1” is configured in my user settings for corresponding ABAP backend system and retrieved via an OData request:
Now we are ready to go back for checking how is aFormatArray filled by the Date Format DD.MM.YYYY. The logic is, to simply replace each character in this.oFormatOptions.pattern with corresponding hard code value in DateFormat.prototype.oStates:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2718378/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SAP UI5 SimpleForm 控制元件的 adjustLabelSpan 屬性UIORM控制元件
- 如何使用SAP UI5 SDK網站查詢指定控制元件的屬性如何使用UI網站控制元件
- SAP UI5 Simple Form 屬性 columnsL,columnsM,columnsXL 的屬性深入剖析試讀版UIORM
- SAP UI5 的 sap-ui-bootstrap script 指令碼標籤各屬性解析UIboot指令碼
- Rust中的derive屬性詳解Rust
- display的flex屬性使用詳解Flex
- SAP UI5 應用 index.html 裡各個屬性賦值邏輯的講解UIIndexHTML賦值
- SAP UI5 確保控制元件 id 全域性唯一的實現方法UI控制元件
- display屬性詳解
- cookie屬性詳解Cookie
- ExtJs控制元件屬性配置詳細JS控制元件
- CSS字型屬性和文字屬性詳解CSS
- SAP UI5 Page 控制元件的建構函式引數講解UI控制元件函式
- SAP UI5 應用 index.html 裡引導 script 屬性的解析原理UIIndexHTML
- SAP UI5 Form 控制元件的 ColumnLayout 佈局特性UIORM控制元件
- SAP UI5 裡的 Busy Indicator 控制元件使用概述UIIndicator控制元件
- SAP UI5 檢視裡的 OverflowToolbar 控制元件UI控制元件
- 授人以漁 - 如何查詢 SAP UI5 官網上沒有提到的控制元件屬性的使用明細試讀版UI控制元件
- CSS定位屬性詳解CSS
- background屬性用法詳解
- UITableView 屬性用法詳解UIView
- css display屬性詳解CSS
- CSS3的content屬性詳解CSSS3
- SAP UI5 DynamicPage 控制元件介紹UI控制元件
- SAP UI5 ManagedObject 的 Association 講解UIObject
- SAP UI5 ManagedObject 的 Event 講解UIObject
- SAP UI5 Web Component的React表格控制元件用法UIWebReact控制元件
- SAP UI5 裡的 Busy Dialog 控制元件使用概述UI控制元件
- Android控制元件的fitSystemWindows屬性Android控制元件Windows
- 關於 SAP UI5 所有控制元件的共同祖先 - sap.ui.base.ManagedObjectUI控制元件Object
- SAP UI5 sap.ui.layout.Grid 控制元件概述UI控制元件
- HTML——② HTML 元素、屬性詳解HTML
- z-index屬性詳解Index
- 授人以漁 - 如何自行查詢任意 SAP UI5 控制元件屬性的文件和技術實現細節試讀版UI控制元件
- ConstraintLayout 屬性詳解 和Chain的使用AI
- HTML5中meta屬性的使用詳解HTML
- script標籤的defer和async屬性詳解
- SAP UI5 FlexibleColumnLayout 控制元件介紹UIFlex控制元件