Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Detect whether the current browser environment supports input[type=date]

License

Notifications You must be signed in to change notification settings

ianwalter/supports-date-input

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@ianwalter/supports-date-input

Detect whether a browser environment or user agent string supports input[type=date]

npm page CI

About

Browser code originates from this StackOverflow answer.

Installation

yarn add @ianwalter/supports-date-input

Usage

Browser:

import supportsDateInput from '@ianwalter/supports-date-input'

// Firefox 65:
supportsDateInput() // => true

// Internet Explorer:
supportsDateInput() // => false

Node.js:

const supportsDateInput = require('@ianwalter/supports-date-input')

// Firefox 65:
supportsDateInput(req.get('user-agent')) // => true

// Internet Explorer:
supportsDateInput(req.get('user-agent')) // => false

License

Hippocratic License - See LICENSE

 

Created by Ian Walter