gs-mobile-cordova-plugin-jslib
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

gs-mobile-cordova-plugin-jslib

Installation

cordova plugin add gs-mobile-cordova-plugin-jslib

Utility

Kind: global class

new Utility()

This represents the mobile device, and provides properties for inspecting the model, version, UUID of the phone, etc.

utility.getInfo(successCallback, errorCallback)

取得行動裝置資訊

Kind: instance method of Utility

Param Type Description
successCallback function The function to call when the heading data is available
errorCallback function The function to call when there is an error getting the heading data. (OPTIONAL)

utility.leftPad(value, length) ⇒ String

leftPad(1,3)

Kind: instance method of Utility
Summary: 固定n位數, 不足補0
Returns: String - str 001

Param Type Description
value int 傳入值
length int n位數

utility.formatNumber(number, point) ⇒ String

formatNumber(1234.123, 2)

Kind: instance method of Utility
Summary: 格式化數字補千分位,固定小數n位
Returns: String - num 1,234.12

Param Type Description
number String 傳入值
point String 固定小數n位

utility.yyyy2yyy() ⇒ String

yyyy2yyy('2020年01月02日')

Kind: instance method of Utility
Summary: 西元年轉民國年
Returns: String - 109年01月02日

utility.yyy2yyyy() ⇒ String

yyyy2yyy('107年01月02日')

Kind: instance method of Utility
Summary: 民國年轉西元年
Returns: String - 2020年01月02日

utility.getCurrentDate() ⇒ String

Kind: instance method of Utility
Summary: 取得當下民國日期
Returns: String - 109年01月02日

utility.getCurrentDateDiff(diff) ⇒ String

getCurrentDateDiff(2) 假設當下是2020/01/03

Kind: instance method of Utility
Summary: 取得當下日期減天數
Returns: String - 傳回就是2020/01/01

Param Type Description
diff String 欲減掉的天數

utility.getCurrentTime() ⇒ String

Kind: instance method of Utility
Summary: 取得當下時間(時跟分)
Returns: String - 18時10分

utility.getLastMonthCurrentDate(num) ⇒ String

假設當天是109/01/02

Kind: instance method of Utility
Summary: 取得N個月前的當天
Returns: String - 回傳108/12/02

Param Type Description
num String 往前n個月

utility.getNextMonthCurrentDate(num) ⇒ String

假設當天是109/01/02

Kind: instance method of Utility
Summary: 取得N個月後的當天
Returns: String - 回傳109/02/02

Param Type Description
num String 往後n個月

utility.getParameterByName(name, num) ⇒ String

假設網址(url)是https://a.b.c/xxx.aspx?x=val1&y=val2, getParameterByName(y,url)

Kind: instance method of Utility
Summary: 取得網址參數的值
Returns: String - 回傳y的值是val2

Param Type Description
name String 欲取得的參數名稱
num String 完整的網址

utility.twd97_to_latlng($x, $y) ⇒ array

Kind: instance method of Utility
Summary: TWD97轉WGS84
Returns: array - 回傳WGS84坐標陣列

Param Type Description
$x float TWD97 x坐標
$y float TWD97 y坐標

Package Sidebar

Install

npm i gs-mobile-cordova-plugin-jslib

Weekly Downloads

11

Version

1.2.3

License

Apache-2.0

Unpacked Size

1.12 MB

Total Files

45

Last publish

Collaborators

  • gisimgis