New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

vue-time

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-time

Display current time.

latest
Source
npmnpm
Version
0.1.4
Version published
Weekly downloads
36
2.86%
Maintainers
1
Weekly downloads
 
Created
Source

vue-time

vue2 npm download unpkg

Display current time. Demo (Once Per Second)

In fact, it is just a practice about how to build a lib.

If you want to handle time, you can use dayjs or moment .

How to use

npm install vue-time

Dev

Install

npm install

Example

<template>
  <div>
    <vue-time :show-date="showDate" :show-day="showDay" :show-time="showTime"></vue-time>
  </div>
</template>
import 'vue-time';
export default {
  components: { vueTime },
  data () {
    return {
      showDate: false,
      showDay: true,
      showTime: true,
      locales: 'zh-CN',
      options: {
        hour12: false,
        timeZone: 'Asia/Shanghai',
        era: 'long',
        weekday: 'long',
        year: 'numeric',
        month: 'numeric',
        day: 'numeric'
      }
    }
  }
}

Display

公元2019年1月28日星期一 19:55:13

Options

AttributeDescriptionTypeOptionsDefault
show-date显示年份日期Boolean——true
show-day显示星期几Boolean——true
show-time显示时间Boolean——true
locales区域String-'zh-CN'
options设置Object-

You can see more info about locales & options from DateTimeFormat - MDN.

AttributeDescriptionTypeDefault
hour1212小时制Booleanfalse
timeZone时区String'Asia/Shanghai'
era公元String'long'
weekday星期几String'long' (short:周几)
year年份String'numeric'
month月份String'numeric'
day星期几String'numeric'

Keywords

time

FAQs

Package last updated on 27 Oct 2020

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