Socket
Socket
Sign inDemoInstall

just-validate-plugin-date

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-validate-plugin-date


Version published
Weekly downloads
592
decreased by-26%
Maintainers
1
Install size
6.28 MB
Created
Weekly downloads
 

Readme

Source

JustValidate plugin date

codecov Codacy Badge Known Vulnerabilities Release workflow

Date validation plugin for JustValidate library

Installation

npm

npm install just-validate-plugin-date --save

yarn

yarn add just-validate-plugin-date

And then use it as an imported module:

import JustValidatePluginDate from 'just-validate-plugin-date';

Or if you don't use module bundlers, just include JustValidatePluginDate script on your page from CDN and call it as window.JustValidatePluginDate:

<script src="https://unpkg.com/just-validate@latest/dist/just-validate-plugin-date.production.min.js"></script>

Usage

This plugin is supposed to use together with JustValidate library. It takes 1 argument: function which returns the validation config.

Check more details and examples here: https://github.com/horprogs/Just-validate

JustValidatePluginDate((fields) => ({
  required: true,
  format: 'dd/MM/yyyy',
  isAfter: fields['#date_after'].elem.value,
  isBefore: fields['#date_before'].elem.value,
}));
import JustValidatePluginDate from 'just-validate-plugin-date';

validator.addField('#date', [
  {
    plugin: JustValidatePluginDate((fields) => ({
      format: 'dd/MM/yyyy',
      isAfter: '',
    })),
  },
]);

Validators

  • isAfter
  • isBefore
  • isBeforeOrEqual
  • isAfterOrEqual
  • isEqual

Keywords

FAQs

Last updated on 15 Jun 2022

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc