🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis
Socket
Book a DemoInstallSign in
Socket

@dzc/quick-time-selection

Package Overview
Dependencies
Maintainers
7
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dzc/quick-time-selection

自定义时间跨度选择器

latest
npmnpm
Version
1.0.4
Version published
Maintainers
7
Created
Source

自定义时间跨度选择器

描述

基于react、antd封装的自定义时间跨度选择器组件,用户可以通过自定义设定时间范围快速选择日期或设置刷新频率使用组件。

效果

安装

npm i @dzc/quick-time-selection --save

使用

import React from 'react';
import QuickTimeSelection from '@dzc/quick-time-selection';

export default () => {

  const timeProps = {
    trigger: "hover", // hover、click
    defaultTime: [], // [moment().subtract(1, 'years'), moment()]
    format: "YYYY-MM-DD HH:mm",
    showTime: { format: "HH:mm" }, // false
    showRefresh: true,
    outFormat: "", // 'YYYY-MM-DD HH:mm:ss'
    onChange: (value) => {
      console.warn("value", value);
    },
    refresh: () => {
      console.warn("页面/数据刷新...");
    }
  }

  return <QuickTimeSelection {...timeProps} />;
};

API

参数说明类型默认值可选值
trigger浮窗触发方式,包含移入显示和点击显示两种方式string'hover''hover' | 'click'
defaultTime设置默认时间array[]如[moment().subtract(1, 'years'), moment()]等
format设置时间格式string' YYYY-MM-DD HH:mm'-
showTime是否显示时分秒object | boolean{ format: "HH:mm" }{ format: "HH:mm" } | false
showRefresh是否显示刷新频率booleantruefalse
outFormat设置组件结果输出的时间格式string'''YYYY-MM-DD HH:mm:ss'
onChange监听时间值变化func--
refresh监听刷新频率功能func--

更新日志

1.0.4 文档优化
1.0.3 文档优化
1.0.2 组件支持刷新控件显示隐藏、优化提示报错问题
1.0.1 组件语言汉化
1.0.0 组件发布

温馨提示

如需支持更多自定义效果,请联系作者逐步完善
开发者:诺克
微信:15858194070

鼓励和支持

开发不易,开源不易。如果这篇经验对您有所帮助,请多给我一些鼓励和支持,谢谢!。

Keywords

time

FAQs

Package last updated on 02 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