Sketchware

Sketchware

  • Docs
  • Community
  • Blog

›Components

The Basics

  • Getting Started
  • Creating a New Project
  • Designing Your App
  • Programming Your App
  • Adding Components
  • Adding Resources

Firebase

  • Getting Started
  • Linking Android App
  • Project Settings
  • Setting Database Rules
  • Enabling Login Methods
  • Enabling Firebase Storage

AdMob

  • Getting Started
  • Creating Ad Unit
  • Sketchware AdMob Settings

Publishing

  • Getting Started
  • Creating a Service Account
  • First Time Publishing

Components

  • Intent
  • SharedPreference
  • Calendar
  • Vibrator
  • Timer
  • Dialog
  • MediaPlayer
  • SoundPool
  • ObjectAnimator
  • Camera
  • FilePicker
  • Gyroscope
  • Firebase DB
  • Firebase Auth
  • Firebase Storage

Calendar

Calendar component is used to handle date and time.

Example

Using setData block to save a value of someValue with the key someKey.

example



Blocks

getNow

Initialize and retrieve the current time value in milliseconds.

get now

TypeExplanationRequired
CalendarCalendar ComponentYes

getTime

Retrieve the time retrieved from the getNow block.

get time

TypeExplanationRequired
CalendarCalendar ComponentYes

setTime

Set the Calendar component to a specific time value (ms).

set time

TypeExplanationRequired
CalendarCalendar ComponentYes
NumberTime in millisecondsYes

addValue

Add an amount of time to the Calendar component.

add value

TypeExplanationRequired
CalendarCalendar ComponentYes
TimeType of time from: YEAR, MONTH, DAY_OF_MONTH, HOUR, MINUTE, SECONDYes
NumberValue to addNo

setValue

Set a specific time value on a Calendar component.

set value

TypeExplanationRequired
CalendarCalendar ComponentYes
TimeType of time from: YEAR, MONTH, DAY_OF_MONTH, HOUR, MINUTE, SECONDYes
NumberValue to setNo

Format

Format the time (ms) into a prettified format. Read more here.

format

TypeExplanationRequired
CalendarCalendar ComponentYes
StringFormat to set the time toNo

difference

Find the difference between two Calendar components.

difference

TypeExplanationRequired
CalendarFirst Calendar ComponentYes
CalendarSecond Calendar ComponentYes
← SharedPreferenceVibrator →
  • Example
  • Blocks
    • getNow
    • getTime
    • setTime
    • addValue
    • setValue
    • Format
    • difference
Sketchware
Docs
Getting Started
Community
FacebookSlack
More
BlogMedium
Copyright © 2018 Sketchware