New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fitbit-easy-clock

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fitbit-easy-clock

Clock classes

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

Fitbit Easy Clock

This package will help you build clockfaces much easier and focus on your designs

Features

  • Handle date & time updates
  • Automatic format time in 12/24 hours depending on the user preferences
  • Configurable padding with 0 for hours and minutes

Installation

Install with npm i fitbit-easy-clock or yarn add fitbit-easy-clock

Usage

import {DigitalClock, TimeData, DateData} from "fitbit-easy-clock"
import document from "document"

const timeLabel = document.getElementById('timeLabel')
const dateLabel = document.getElementById('dateLabel')

function onTimeUpdate(data: TimeData) {
  timeLabel.text = `${data.hours}:${data.minutes}`
}
function onDateUpdate(data: DateData) {
  dateLabel.text = `${data.day}/${data.month}/${data.year}`
}

new DigitalClock(onTimeUpdate, onDateUpdate, {padHours: true, padMinutes: true})

Config

interface DigitalClockConfig {
  granularity?: 'off' | 'seconds' | 'minutes' | 'hours',
  padHours?: boolean,
  padMinutes?: boolean,
  hourFormat?: '12h' | '24h' // If not set will be used the device preferences
}

Interfaces

interface TimeData {
  hours: string,
  minutes: string
}

interface DateData {
  day: number,
  month: number,
  year: number,
  weekDay: number
}

FAQs

Package last updated on 14 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc