Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

extract-time

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-time

Extracts time from an arbitrary text input.

Source
npmnpm
Version
3.3.1
Version published
Weekly downloads
92
10.84%
Maintainers
1
Weekly downloads
 
Created
Source

extract-time ⏰

Travis build status Coveralls NPM version Canonical Code Style Twitter Follow

Extracts time from an arbitrary text input.

Features

  • Deterministic and unambiguous time parsing.

Usage

import extractTime from 'extract-time';

extractTime('extracts time from anywhere within the input 14:00');
// [{time: '14:00'}]

extractTime('extracts multiple times located anywhere within the input: 16:00, 18:00');
// [{time: '16:00'}, {time: '18:00'}]

extractTime('distinguish between the civilian 1:30 PM ...');
// [{time: '13:30'}]

extractTime('... and military time formats 13:30');
// [{time: '13:30'}]

Signature

/**
 * @property time 24-hour military time.
 */
type TimeMatchType = {|
  +time: string
|};

/**
 * @param subject Arbitrary text input.
 */
type extractTime = (subject: string) => $ReadOnlyArray<TimeMatchType>;

  • extract-date – Extracts date from an arbitrary text input.
  • extract-price – Extracts price from an arbitrary text input.

Keywords

time

FAQs

Package last updated on 21 Nov 2019

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