Facing issue in nebular datepicker - angular8

Facing issue in nebular date picker And Getting date as a day before. Ex. If I select 2020/05/05 and checks in database the date the goes to 2020/05/04.

Related

Get date today, if no data - get data from yesterday (dynamic)

I have such an issue. I have a report that is built around today's date. We see data only from today. On Hand units from today.
However, we have many import issues and sometimes import fails and there is no data in this report. I was wondering if there may be a way to make it dynamic like to use MAX function with getdate() or anything similar. I always want to see data from today, however if there is no data available for today I would like to see the data from yesterday. If not from yesterday from a day before yesterday.
I need to change the date logic to just pull the data for the max date.
Does someone know how it can be done?
where sku.ohpost = cast(getdate()as date)
try this If column sku.ohpost type is date
where sku.ohpost = ( select max(sku.ohpost ) from mytable)

Choose a specific month or week when rendering a Vuetify calendar

When the page loads I would like to be able to specify which week or month is being displayed in vuetify for week and month calendars, respectively. So far I Haven't found a way to do this on page load. It appears to show me the month or week that includes today's date no matter what I do.
Okay, so it appears that you simply need to set the calendar's v-model or value to a simple string, i.e. '01-01-2020'.

How to convert timestamp to days?

I have my MySQL database inserting timestamp when I upload a record, so what's entered is something like 2020-04-02 16:59:29. Is there a Vue.Js way to convert that into something like 10 Days Ago? If so, can anyone give the code for conversion in Vue.Js?
I hold the fetched DB records in an object called data_local as in my bellow code.
Last Activity : {{data_local.updated_at}} days ago
Use moment.js, you can get your desired data the way you want. First do install moment and then import & use.
Below are ways to get days:
Ex-1:( This will provide you No_of_Days days ago ( e.g- 10 days ago)
moment("2020-04-02 16:59:29").fromNow()
Ex-2: (If you want only 10 days without ago then use below)
moment("2020-04-02 16:59:29").fromNow(true)
For more information visit https://momentjs.com/

v-date-picker not opening on desired month

I'm working with a v-date-picker in my vue.js application. I'm trying to get it to open on a specific month. I set the min prop to a certain date in order to disable any date before the min date. If this min date is on a future month, it would be nice if the date picker would open on that month instead of the current month. I'm not able to get it to do this.
There is this discussion:
https://github.com/nathanreyes/v-calendar/issues/113
...which says that there is a bug in the v-date-picker for setting the month it opens on, but none of the solutions or work arounds work for me.
Any help would be much appreciated. Thanks.
use "show-current" attribute you can open your calendar with the desired date. <v-date-picker v-model="month1" show-current="2013-18" type="month"></v-date-picker>
check this link.
https://codepen.io/neha-shivhare/pen/ZEXXMdE?editors=101

How to show the enabled dates directly in p-calender

I have an input field that uses the component. Say I have disabled the dates till 15th May. When I click on the calender, the current month is shown as April and all dates in it are disabled. How can I make the current month as the one that doesn't have disabled dates? (May month in this case)
Use defaultDate to display the current month you want to first display. The defaultDate is only applicable if ngModel is not initially set. See similar issue (Primeng: p-calender default date not working).
<p-calendar [(ngModel)]="startDate" [disabledDates]="invalidDates" [defaultDate]="defaultDate" showIcon="true"></p-calendar>
Stackblitz example