MCPcopy Index your code
hub / github.com/catc/react-timekeeper

github.com/catc/react-timekeeper @v2.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.1 ↗ · + Follow
124 symbols 266 edges 58 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

React Timekeeper

build downloads license

<b>
    Time picker based on the style of the
    <a href="https://play.google.com/store/apps/details?id=com.google.android.keep" target="_blank">
    Android Google Keep
    </a>
    app.
</b>

Features - supports both 12 hour and 24 hour mode, and flexible time formats - simple to use with many customizable options - smooth, beautiful animations with react spring - typescript support - css variable support for custom styles

Installation

$ yarn add react-timekeeper

# or via npm
$ npm install --save react-timekeeper

Version 2+ of timekeeper requires react hooks (v16.8). If you're using an older version of react, install timekeeper v1 via

$ npm install --save react-timekeeper@^1.0.0

Usage

import React, {useState} from 'react';
import TimeKeeper from 'react-timekeeper';

function YourComponent(){
  const [time, setTime] = useState('12:34pm')

  return (



      <TimeKeeper
        time={time}
        onChange={(data) => setTime(data.formatted12)}
      />
      <span>Time is {time}</span>



  )
}

All styles are inlined via emotion so no css imports are required.

API

For full api and examples, see API docs and examples

Development

  1. Clone the repo
  2. nvm use v12.16.0 (or anything >12+)
  3. yarn install
    • may also need to install react since it's a peer dev: yarn add -P react react-dom
  4. npm run docs:dev
  5. Navigate to localhost:3002

Contributing

Before submitting a PR, ensure that: 1. you follow all eslint rules (should be automatic) 1. all tests pass via npm run tests 1. everything builds - docs - npm run docs:build - lib - npm run lib 1. provide detailed info on what bug you're fixing or feature you're adding - if possible include a screenshot/gif


Other useful commands: - new npm releases: - bump version: npm version NEW_VERSION, commit and push - CI should publish to npm automatically - new github releases - manual (TODO - add github action)

Extension points exported contracts — how you extend this code

Props (Interface)
(no doc)
src/components/ClockHand.tsx
Time (Interface)
(no doc)
src/helpers/types.ts
Config (Interface)
(no doc)
src/hooks/useConfigContext.tsx
Props (Interface)
(no doc)
docs/js/components/code.tsx
CommonProps (Interface)
(no doc)
src/components/Numbers.tsx
Time24 (Interface)
(no doc)
src/helpers/types.ts
Props (Interface)
(no doc)
src/hooks/useConfigContext.tsx
Props (Interface)
(no doc)
docs/js/components/text.tsx

Core symbols most depended-on inside this repo

isHourMode
called by 8
src/helpers/utils.ts
isMinuteMode
called by 6
src/helpers/utils.ts
useConfig
called by 6
src/hooks/useConfigContext.tsx
useTimekeeperState
called by 6
src/hooks/useStateContext.tsx
getClockHandLength
called by 5
src/helpers/constants.ts
parseTime
called by 4
src/helpers/time.ts
rad
called by 4
src/helpers/math.ts
numbersStyle
called by 3
src/components/styles/numbers.ts

Shape

Function 93
Interface 25
Enum 3
Class 2
Method 1

Languages

TypeScript100%

Modules by API surface

src/helpers/math.ts8 symbols
src/hooks/useStateContext.tsx7 symbols
src/helpers/utils.ts6 symbols
src/helpers/disable-time.ts6 symbols
src/helpers/constants.ts6 symbols
src/components/TimeDropdown.tsx6 symbols
src/components/Numbers.tsx6 symbols
src/components/__tests__/helpers/dom.tsx5 symbols
src/hooks/useConfigContext.tsx4 symbols
src/helpers/types.ts4 symbols
src/components/styles/top-bar.ts4 symbols
src/components/TopBar.tsx4 symbols

For agents

$ claude mcp add react-timekeeper \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact