Clock Component


Properties

timerAlwaysFires
  Will fire even when application is not showing on the screen if true
Data type: boolean
Designer Writable true <clock name="clockName" timerAlwaysFires="true">
Code Writeable true clockName.timerAlwaysFires = true
Code Readable true let variable = clockName.timerAlwaysFires

timerEnabled
  Specifies whether the Timer event should run.
Data type: boolean
Designer Writable true <clock name="clockName" timerEnabled="false">
Code Writeable true clockName.timerEnabled = false
Code Readable true let variable = clockName.timerEnabled

timerInterval
  Specifies the interval between subsequent Timer events. Note: Drift may occur over time and that the system may not honor the timing specified here if the app or another process on the phone is busy.
Data type: number
Designer Writable true <clock name="clockName" timerInterval="1000">
Code Writeable true clockName.timerInterval = 1000
Code Readable true let variable = clockName.timerInterval

class
  The styling class of the the component
Data type: string
Designer Writable true <clock name="clockName" class="Test class">
Code Writeable false
Code Readable false

id
  The styling id of the the component
Data type: string
Designer Writable true <clock name="clockName" id="Test id">
Code Writeable false
Code Readable false

name
  The name of the component that will be used to refer to it in code.
Data type: string
Designer Writable true <clock name="clockName" name="testComponent">
Code Writeable false
Code Readable false

Methods

Method name Description Parameters
addDays Returns an instant in time some days after the given instant.
clockName.addDays(instant, quantity)
clockName.addDays(0, 100)
instant InstantInTime
quantity number
addDuration Returns an instant in time some duration after the argument
clockName.addDuration(instant, quantity)
clockName.addDuration(0, 1000)
instant InstantInTime
quantity number
addHours Returns an instant in time some hours after the given instant.
clockName.addHours(instant, quantity)
clockName.addHours(0, 1000)
instant InstantInTime
quantity number
addMinutes Returns an instant in time some minutes after the given instant.
clockName.addMinutes(instant, quantity)
clockName.addMinutes(0, 10000)
instant InstantInTime
quantity number
addMonths Returns an instant in time some months after the given instant.
clockName.addMonths(instant, quantity)
clockName.addMonths(0, 10000)
instant InstantInTime
quantity number
addSeconds Returns an instant in time some seconds after the given instant.
clockName.addSeconds(instant, quantity)
clockName.addSeconds(1, 100000)
instant InstantInTime
quantity number
addWeeks Returns An instant in time some weeks after the given instant.
clockName.addWeeks(instant, quantity)
clockName.addWeeks(0, 100000)
instant InstantInTime
quantity number
addYears Returns an instant in time some years after the given instant.
clockName.addYears(instant, quantity)
clockName.addYears(0, 10000)
instant InstantInTime
quantity number
dayOfMonth Returns the day of the month.
clockName.dayOfMonth(instant)
clockName.dayOfMonth(0)
instant InstantInTime
duration Returns the milliseconds by which end follows start (+ or -)
clockName.duration(start, end)
clockName.duration(0, 1000)
start InstantInTime
end InstantInTime
durationToDays Returns the duration converted from milliseconds to days.
clockName.durationToDays(duration)
clockName.durationToDays(3245673412)
duration number
durationToHours Returns the duration converted from milliseconds to hours.
clockName.durationToHours(duration)
clockName.durationToHours(5231323)
duration number
durationToMinutes Returns the duration converted from milliseconds to minutes.
clockName.durationToMinutes(duration)
clockName.durationToMinutes(5432452)
duration number
durationToSeconds Returns the duration converted from milliseconds to seconds.
clockName.durationToSeconds(duration)
clockName.durationToSeconds(253256353)
duration number
durationToWeeks Returns the duration converted from milliseconds to weeks.
clockName.durationToWeeks(duration)
clockName.durationToWeeks(2453253)
duration number
formatDate Converts and formats an instant into a string of date with the specified pattern. To learn more about valid patterns, please see SimpleDateFormat. https://developer.android.com/reference/java/text/SimpleDateFormat
clockName.formatDate(instant, pattern)
clockName.formatDate(0, "yyMMddHHmmssZ")
instant InstantInTime
pattern string
formatDateTime Converts and formats an instant into a string of date and time with the specified pattern. To learn more about valid patterns, please see SimpleDateFormat. https://developer.android.com/reference/java/text/SimpleDateFormat
clockName.formatDateTime(instant, pattern)
clockName.formatDateTime(0, "yyMMddHHmmssZ")
instant InstantInTime
pattern string
formatTime Converts and formats the given instant into a string with the specified pattern. To learn more about valid patterns, please see SimpleDateFormat. https://developer.android.com/reference/java/text/SimpleDateFormat
clockName.formatTime(instant)
clockName.formatTime(0)
instant InstantInTime
getMillis Returns the instant in time measured as milliseconds since 1970.
clockName.getMillis(instant)
clockName.getMillis(14123)
instant InstantInTime
hour Returns the hours for the given date.
clockName.hour(instant)
clockName.hour(37653)
instant InstantInTime
makeDate Returns an instant in time specified by year, month, date in UTC. Valid values for the month field are 1-12 and 1-31 for the day field.
clockName.makeDate(year, month, day)
clockName.makeDate(1970, 1, 1)
year number
month number
day number
makeInstant Returns an instant in time specified by MM/dd/YYYY hh:mm:ss or MM/dd/YYYY or hh:mm.
clockName.makeInstant(from)
clockName.makeInstant("01/01/1970 12:15:12")
from string
makeInstantFromMillis Returns an instant in time specified by the milliseconds since 1970 in UTC.
clockName.makeInstantFromMillis(millis)
clockName.makeInstantFromMillis(5243543131)
millis number
makeInstantFromParts Returns an instant in time specified by year, month, date, hour, minute, second in UTC.
clockName.makeInstantFromParts(year, month, day, hour, minute, second)
clockName.makeInstantFromParts(1970, 1, 1, 12, 15, 32)
year number
month number
day number
hour number
minute number
second number
makeTime Returns an instant in time specified by hour, minute, second in UTC.
clockName.makeTime(hour, minute, second)
clockName.makeTime(12, 32, 19)
hour number
minute number
second number
minute Returns the minutes for the given date.
clockName.minute(instant)
clockName.minute(0)
instant InstantInTime
month Returns the number of the month for the given instant.
clockName.month(instant)
clockName.month(0)
instant InstantInTime
monthName Returns the name of the month for the given instant.
clockName.monthName(instant)
clockName.monthName(0)
instant InstantInTime
now Returns the current instant in time read from phone's clock.
clockName.now()
second Returns the seconds for the given instant.
clockName.second(instant)
clockName.second(0)
instant InstantInTime
systemTime Returns the phone's internal time.
clockName.systemTime()
weekday Returns the weekday for the given instant.
clockName.weekday(instant)
clockName.weekday(0)
instant InstantInTime
weekdayName Returns the name of the weekday for the given instant.
clockName.weekdayName(instant)
clockName.weekdayName(0)
instant InstantInTime
year Returns the year of the given instant.
clockName.year(instant)
clockName.year(0)
instant InstantInTime
addEventListener Method used to create event listeners.
See Events below for samples.
eventName string
eventCallbackFunction callback

Events

Event name Description Parameters
timer The Timer event runs when the timer has gone off.
clockName.addEventListener(
    "timer",
    function () {
        //Your code here
    }
)