Skip to content

Tag: momentjs

Moment date conversion from datepicker format problem

I have a problem with converting date time which comes from datepicker to moment (I use this library) time format. What I get from datepicker: 2021-01-30T07:00:00.000Z The code that I used via moment: Output I get with this implementation: Fri Apr 30 2021 00:00:00 GMT-0700 (Mountain Standard Time) What I expe…

Formatting ISO time with Luxon

Using Luxon JS, I’ve been trying to format datetime to output in a certain format, using the native toISO function: This is what I get: And this is what I want: I know that they are both equivalent in terms of unix time and mean the same thing except in a different format, I just want to be able to

Disable Weekends on ng2-date-picker

I am looking for a function that can disable weekends on my datepicker. I know that I can use isDayDisabledCallback to disable dates but how can I only disable weekends. Answer In the configuration you can set the callback isDayDisabledCallback like that for exclude Saturday and Sunday.

Vuetify tooltip refresh/rerender on hover

I have a vuetify tooltip component. In the tooltip I have a {{date | moment}}. I get a static a few seconds ago. I want every time I hover over the button, to refresh the button tooltip to the current elapsed time (10 minutes ago for example). I can’t figure out how to rerender the tooltip on hover with…

moment.js error, sometimes ignores the day

I have a problem with moment.js and it’s that I have two dates (initial and final) when I initialize the dates, the initial is fine but the final date is not, moment.js ignores the day part of the date ,I set “2020-10-05T09:00” but in the console I get “2020-10T17:15Z”, as you ca…

Generate an array of dates and year using moment js

I have this code : I want to get something like : Have you an idea about that. My function is not working properly. Answer You can not declare such array structure, but you could use Object where keys would be years and values would be arrays of strings. Therefore I would propose such code which will create a…