Giter Club home page Giter Club logo

vuetify-datetime-picker's People

Contributors

casperlaitw avatar daniluk4000 avatar darrenfang avatar milost1982 avatar thenoim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vuetify-datetime-picker's Issues

SyntaxError Unexpected Identifier

I want to use this plugin in my Nuxt.js/VuetifyJs application. For this purpose, I created a plugins/datetime-picker.js file:


import Vue from 'vue'
import DatetimePicker from 'vuetify-datetime-picker'

Vue.use(DatetimePicker)

And in nuxt.config.js, declare the plugin as recommended on the documentation:

export default {
  plugins: ['~/plugins/datetime-picker']
}

I run yarn run dev to launch the server, I do not see any error in the Terminal, but when I open the broswer on http://localhost:3000/ I see:

SyntaxError
Unexpected identifier

Link to reproduce

Github link for the bug
Why this is happening ? I simply followed the steps mentioned on the documentation.
How to fix this ?

Property 24hr

I want to user the prop "format="24hr", but don`t work properly

Doesn't work. None of the component render

When using this I get these errors that seem to not be able to find any Vuetify components. Yet Vuetify is working just fine in my application.

If I copy/paste the component from github it does work. Albeit never updates the text field value until something else is clicked on, which is annoying.

image

When will support SSR ?

Without flag ssr: false in Nuxt.
I have error:

Cannot use import statement outside a module

Using custom display format completely breaks the picker

I would like to use the format prop to manipulate what the displayed datetime in the input looks like:
ddd D MMMM YYYY, HH:mm"

This works fantastic, until I click the input to bring up the picker and the value is way out, the picker displays (and outputs) completely obscure dates, e.g. 2000-01-10 00:00:00.

Some examples:
input: 2018-03-31 10:00:00
Output: 2000-01-10 00:00
Desired: Mon 31 March 2018, 10:00

Input: 2018-06-18 16:45:00
Output: 2030-01-20 00:00:00
Desired: Mon 18 June 2018, 16:45

Struggling to find any correlation between these results, but my thought was that the plugin should be parsing the raw value in the v-model rather than the formatted value for the text box?

Date and time selection limits

Hello,

I have downloaded the .vue and modified the source code. Date and time selection limits added.

This way, when the date is selected and equals date limit, then it sets the time limit

modifications

// template:
<v-time-picker 
  ...
  :max="maxTime"  
// ... 

props:
// ...
datetimeMax: {
  type: [Date],
  default: null,
},
// ...

computed: {
// ....
  maxDate() {
    return this.datetimeMax
      ? this.datetimeMax.toISOString().substr(0, 10)
      : null;
  },
  maxTime() {
    if (!this.datetimeMax || !this.date) 
      return null;
    var eqDay =
      new Date(this.date).toISOString().substr(0, 10) ==
      this.datetimeMax.toISOString().substring(0, 10); 
    return eqDay 
      ? this.datetimeMax.toLocaleTimeString() 
      : null;
  },
// ...

Errors if using full installation

I use full installation of vuetify https://vuetifyjs.com/en/getting-started/quick-start#full-installation

import Vue from 'vue';
import Vuetify from 'vuetify/lib';
import DatetimePicker from 'vuetify-datetime-picker';
import '@mdi/font/css/materialdesignicons.css';

Vue.use(Vuetify);
Vue.use(DatetimePicker);
export default new Vuetify({
  theme: {
    themes: {
      light: {
        primary: '#06f',
        secondary: '#424242',
        accent: '#82B1FF',
        error: '#FF5252',
        info: '#2196F3',
        success: '#4CAF50',
        warning: '#FFC107',
      },
    },
  },
  icons: {
    iconfont: 'mdi',
  },
});

But after adding datepicker there components errors
image

Settings elevation to 0

Hi,

If you put the class "elevation-0" on date and time pickers, the widget look like better and more unified. I think this must be the default configuration.

       <v-datetime-picker
        v-model="from"
        :datePickerProps="{'show-week': true, 'class': 'elevation-0'}"
        :timePickerProps="{'format': '24hr', 'class': 'elevation-0'}">

Screenshot_2020-02-06 stoco

Regards,

min for datetimepicker

how do we set min for datetimepicker ?
lets say my min is '2020-08-09 04:00:00', i need to set for both date-picker-props.min = '2020-08-09' and time-picker-props.min = '04:00:00' ?
if the user change the date, timepicker still cant select hours lower than '04:00:00'.
or is there a method that i missed ?

Parse failed.

ERROR in ./node_modules/vuetify-datetime-picker/src/components/DatetimePicker.vue 1:0
Module parse failed: Unexpected token (1:0)

Not working with webpack 4.

I am getting this error:

 in ./node_modules/vuetify-datetime-picker/src/stylus/main.styl (./node_modules/css-loader!./node_modules/stylus-loader!./node_modules/vuetify-datetime-picker/src/stylus/main.styl)
Module build failed (from ./node_modules/stylus-loader/index.js):
TypeError: Cannot read property 'stylus' of undefined
    at Object.module.exports (C:\Users\Bruger\Source\Repos\konxion-insights\Konxion.Insights\Konxion.Insights\node_modules\stylus-loader\index.js:29:33)
 @ ./node_modules/vuetify-datetime-picker/src/stylus/main.styl 4:14-99 14:3-18:5 15:22-107
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./App/Components/Backend/SystemSettings.vue?vue&type=script&lang=js
 @ ./App/Components/Backend/SystemSettings.vue?vue&type=script&lang=js
 @ ./App/Components/Backend/SystemSettings.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./App/Components/Backend/BackendSettings.vue?vue&type=script&lang=js
 @ ./App/Components/Backend/BackendSettings.vue?vue&type=script&lang=js
 @ ./App/Components/Backend/BackendSettings.vue
 @ ./App/router/index.js
 @ ./App/index.js
 @ multi event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true ./App/index.js

I am unsure how to fix this,
Versions:

"style-loader": "^0.22.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vuetify-datetime-picker": "^1.0.3",
"vuetify": "^1.1.8",
"webpack": "^4.16.3",
"vue": "^2.5.16",

Live demo

Please provide a live demo link in the README.md

Set date on click

Hello,

I was wondering if it's at all possible to set the datetime after I've opened the dialog.
I want it to start at null, but when I click it, it would be nice if it were to show the current date in the datepicker, rather than showing an empty div.

Thanks!

Error in production built

The installation works fine on my local machine but when i ran "npm run build" for production depolyment, i got the below error in the console:

[Vuetify] v-ripple can only be used on block-level elements
And styling of the datetime picker is all messed up.

image

Time Defaults To Previous Hour When Minutes Is Not Selected

How to reproduce:

  • Select a day on the calender.
  • Select a hour
  • Select a minute
  • Repeat the first two steps, but in the second step choose a different hour
  • Don't select minute and just hit ok.

Expected Results:

  • The hour value should have been updated to the new hour value.

Actual Outcome:

  • The hours value stayed the same as the previous input.

Admittedly, this may be an upstream bug somewhere in the timepicker component.

"Event Access_time" panel?

I just attempted to use this component and for some reason it has a panel at the top with what appear to be buttons or links that do nothing but are labelled "Event" and "Access_time" and are causing a scroll bar to appear to the right.

What are these and how do I remove them?

Allow manual input on text field

Add a prop to allow users to manually input the desired date and time with their keyboard.

  • When the prop is set to true:
    • Set readonly prop on text field to false.
    • Only open the dialog when clicking the calendar icon, not the text field.
    • On text field @blur event, validate input (input should have the format dateFormat + " " + timeFormat):
      • If no input, don't do anything.
      • If input isn't correct, display format error using vuetify's error-messages.
      • If input is correct, update datetime picker value and emit @input event.
    • On text field @focus event:
      • Clear vuetify error-messages prop.
    • When users select a new value from the dialog:
      • Update the text field value.

That may look too specific, but I'm open to changes. Please let me know what you think, I'm willing to open a PR myself if this is approved.

Unknown custom element: <v-dialog>

I included your datetime-picker into my project with Vuetify >2.0

While I can use the default date and time pickers without any issues I always receive the following error when I try to use your library

[Vue warn]: Unknown custom element: <v-dialog> - did you register the component correctly? For recursive components, make sure to provide the "name" option

I use v-dialog by myself without any issues but it seems to break in your library. Is there anything I can do?

how to select the pre-filled date and time value of field in dialog box?

I have tried this #17 but still I am facing the issue.

This is the component

<v-datetime-picker
 label="Date Time"
 v-model="datetime"
 :width='410'
 format='YYYY-MM-DD HH:mm:ss'
 useSeconds
 okText='SAVE'
 clearText='CANCEL'
 @input='inputChange()'
>
</v-datetime-picker>

Script

export default{
 data(){
  return {
	datetime: new Date(),
            }
 },
methods:{
 getDate(timestamp) {
  if(this.datetime){
	this.datetime = new Date(timestamp);
	console.log(this.datetime); //this update the datetime property in data object
   }
 },
  editItem(item){
	this.getDate(item.created);
  }
}

So, when I am calling edit item and passing the api response with item parameter and inside this calling the getData function and passing the timestamp i.e. item.created.
Now when getDate method is called it update the datetime property in data object,but when I open the modal it select the current date or today's date.

For example, In text field I am getting this date and time 2020-01-01 17:25:25 through api response but when I open the modal it select the today's date,

How I can Select this date in my dialog?

If I am passing the timestamp value as param in new Date() like

datetime : new Date(12345679892345)

then it select the upcoming datetime in modal but now it select the same datetime for every entery. Can we make this dynamic?

And one more thing, when I click on cancel button of modal it erases the datetime value from field, how to prevent from this?

how to select seconds ?

In the current version, I can only select the hours and minutes and my place for seconds in 00, How do I select the seconds also?
And how I can call a custom method on click of save button?

v-model doesn't update the displayed value with Vuetify 2

I have Vuetify 2.1.0. Assigning a model to the component updates the datetime prop, but the input field won't update. In other words, the data ('date' and 'time') is not updating when the v-model's related variable changes.

For a bit of context, here is a simple example of how I use the picker:

<template>
  <v-datetime-picker
    v-model="event.start"
    label="Start"
  ></v-datetime-picker>
</template>

<script>
export default {
  data: () => ({
    event: {
      start: null
    }
  })
}

Modifying 'event.start' won't update the data in the picker.

The reason I need this is because the picker is in a form that is only shown once the user clicks a date in a calendar. They can create events and that field is filled for them, making things easier. That means I should be able to change its value from the parent component after the picker is created. This is something that used to work when I used Vuetify ^1.5.5. Probably because it was destroying the picker.

For now, all I can do is using v-if so the picker is destroyed once my dialog closes. And is created again when the form opens. I hoped there would be something more efficient and intuitive.

Design

It works fine for me in local. But creating build and when I deploy it live it does not work properly.
screenshot from 2019-02-02 11-51-56
screenshot from 2019-02-02 11-56-49

In live, I get some warnings in my local

Computed property "formattedDatetime" was assigned to but it has no setter

The v-text-field

<v-text-field
        slot="activator"
        :label="label"
        v-model="formattedDatetime"
        // :value="formattedDatetime" <-- solution
        readonly>
</v-text-field>

is bound using v-model however its val is provided by the computed property

formattedDatetime () {
        return this.datetime ? moment(this.datetime).format(this.format) : ''
}

Perhaps changing v-model to :value will remove the error?

Set Time component with current time

Hi, thanks for the project, it was very useful.

Just a detail. I'm not managing to set the current time with the clock component.

How can I do that?

Thank you.

No option to cancel

Cannot 'Cancel' or go out of the Modal once you are in.

Would be good to have a Cancel Option

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.