
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
vue-datetime3
Advanced tools
Mobile friendly datetime picker for Vue. Supports date, datetime and time modes, i18n and disabling dates.
Mobile friendly datetime picker for Vue. Supports date, datetime and time modes, i18n and more.
This is a fork and port of Vue 2 vue-datetime by mariomka to support Vue 3 and typescript. For older versions of Vue refer to aforementioned project.
yarn add luxon vue-datetime3 weekstart
Or
npm install --save luxon vue-datetime3 weekstart
weekstart is optional, is used to get the first day of the week.
import createApp from 'vue'
import createDatetime from 'vue-datetime'
// You need a specific loader for CSS files
import 'vue-datetime/dist/style.css'
const app = createApp();
app.use(createDatetime());
<datetime v-model="date"></datetime>
Parameter | Type | Default | Description |
---|---|---|---|
v-model (required) | ISO 8601 String | - | Datetime. |
type | String | date | Picker type: date, datetime or time. |
input-id | String | '' | Id for the input. |
input-class | String , Array or Object | '' | Class for the input. |
input-style | String , Array or Object | '' | Style for the input. |
hidden-name | String | null | Name for hidden input with raw value. See #51. |
value-zone | String | UTC | Time zone for the value. |
zone | String | local | Time zone for the picker. |
format | Object or String | DateTime.DATE_MED , DateTime.DATETIME_MED or DateTime.TIME_24_SIMPLE | Input date format. Luxon presets or tokens. |
phrases | Object | {ok: 'Ok', cancel: 'Cancel'} | Phrases. |
use12-hour | Boolean | false | Display 12 hour (AM/PM) mode |
hour-step | Number | 1 | Hour step. |
minute-step | Number | 1 | Minute step. |
min-datetime | ISO 8601 String | null | Minimum datetime. |
max-datetime | ISO 8601 String | null | Maximum datetime. |
auto | Boolean | false | Auto continue/close on select. |
week-start | Number | auto from locale if weekstart is available or 1 | First day of the week. 1 is Monday and 7 is Sunday. |
flow | Array | Depends of type | Customize steps flow, steps available: time, date, month, year. Example: ['year', 'date', 'time'] |
title | String | '' | Popup title. |
hide-backdrop | Boolean | false | Show/Hide backdrop. |
backdrop-click | Boolean | true | Enable/Disable backdrop click to cancel (outside click). |
Input inherits all props not defined above but style
and class
will be inherited by root element. See inheritAttrs option
The component is based on Luxon, check out documentation to set time zones and format.
Date internationalization depends on luxon. Set the default locale.
import { Settings } from 'luxon'
Settings.defaultLocale = 'es'
Component emits the input
event to work with v-model
. More info.
close
event is emitted when the popup closes.
Also, input text inherits all component events.
You can customize the component using named slots.
Available slots: before
, after
, button-cancel
and button-confirm
<datetime v-model="date" input-id="startDate">
<label for="startDate" slot="before">Field Label</label>
<span class="description" slot="after">The field description</span>
<template slot="button-cancel">
<fa :icon="['far', 'times']"></fa>
Cancel
</template>
<template slot="button-confirm">
<fa :icon="['fas', 'check-circle']"></fa>
Confirm
</template>
</datetime>
You can also use slot-scope
to determine which view is currently active:
<template slot="button-confirm" slot-scope="scope">
<span v-if='scope.step === "date"'>Next <i class='fas fa-arrow-right' /></span>
<span v-else><i class='fas fa-check-circle' /> Publish</span>
</template>
Theming is supported by overwriting CSS classes.
npm run test
Note: Currently not working. Tests need to be rewritten to ViTest.
npm run demo
Bundle the js and css to the dist
folder:
npm run build
7 March 2023
0d13c28
2f3ade7
5af5d47
3a23c90
ab22b91
4b0d05b
eed9b6e
af257cb
bcf1a83
49c1f87
b35563c
c5a97d9
10096f7
6551465
38f8c22
52eae4f
ebab314
21e7d78
5534287
8af46c1
9d33af5
d6770a1
40ceddf
4a5a59b
15dd190
324725f
1286b6c
FAQs
Mobile friendly datetime picker for Vue. Supports date, datetime and time modes, i18n and disabling dates.
The npm package vue-datetime3 receives a total of 697 weekly downloads. As such, vue-datetime3 popularity was classified as not popular.
We found that vue-datetime3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.