vuejs hotel date picker #check-in-changed cannot send value - vue.js

i have been trying to send #check-in-changed and #check-out-changed values to modal title and when i console log getStartDate method i get correct date but when i send it to modal title i get value of undefined. Can you please help?
hotel-date-picker:
<HotelDatePicker :gridStyle="false" :showSingleMonth="true" :minNights="7" :alwaysVisible="true"
:showPrice="true" priceSymbol='€' :periodDates="detail.periodDates"
:disabledDates="detail.disabledDates" #check-in-changed="getStartDate"
#check-out-changed="getEndDate">
</HotelDatePicker>
methods:
getStartDate(newDate) {
console.log(newDate)
return (newDate)
},
getEndDate(newDate){
return (newDate)
},
console.log of getStartDate:
Date Mon Nov 22 2021 00:00:00 GMT+0100 (Central European Standard Time)

Related

Adding one month to a selected date while keeping current date as default

I have a field that shows the current date and next to that is a counter where you can add one month to the current date. This was as intended, because I always want the current date to be the default one. But I would also like to allow my users to pick a different date and then count the months from that selected date. They can't do this right now. if they select a date and add one month, the date will automatically update to be todays date + 1 month.
How can I change this so that the default date is still the current date, while allowing users to select a different date and add one month to THAT date.
Eg. if today is 15/11/2022 and the user picks the 17th and adds one month, I would like the date to change to to 17/12/2022. Right now it will only change to 15/12/2022 even if the user enters the 17th.
<template>
<date-picker v-model="startDate" format="DD/MM/YYYY"/>
<b-form-spinbutton v-model="counter" min="0"/>
</template>
<script>
export default {
data() {
return {
counter: 0,
startDate: moment(new Date()).format('YYYY-MM-DD')
}
},
methods: {
populateDateAccordingly() {
this.startDate = moment().format('YYYY-MM-DD');
this.startDate = moment().add(this.counter, 'M').format('YYYY-MM-DD');
}
},
watch: {
counter : 'populateDateAccordingly'
},
}
}
</script>

FullCalendar - Get info range when use eventMouseEnter

In my case I have setup the timeline like:
events: [{
title: 'My schedule'
start: '2021-07-08T01:00:00Z',
end: '2021-07-08T03:00:00Z',
}]
Which mean that my time 00:00UTC will be shifted to local time GMT+7 and timeZone:'local' (as default) , follow as this doc https://fullcalendar.io/docs/date-parsing
At ui view is render timeline exactly what I want that 2021-07-08T08:00:00Z GMT+7 & 2021-07-08T10:00:00Z GMT+7 (Perfect).
But when I try to get back that info with:
eventMouseEnter(info) {
console.log(info.event._instance.range);
}
I get this:
{
end: Wed Jul 08 2021 15:08:10 GMT+0700 (Indochina Time) {}
start: Wed Jul 08 2021 17:08:10 GMT+0700 (Indochina Time) {}
}
Don't know why but, is seem like i get the wrong info or that info just add more GMT+7?
Thanks

how can i pass a date formate in agenda jobs

const mongoconection =url;
const agenda = new Agenda({
db: {
address: mongoconection,
collection: "agendajobs",
option: { useUnifiedTopology: true }
}
});
new Promise(resolve=> agenda.once('ready', resolve));
agenda.define("say hello", job => {
console.log('hello');
});
(async function() {
await agenda.start();
await agenda.schedule(4/2/2020, 'say hello');
//repeat every
})();
how can I pass the dynamic date to the agenda?``
it's falling if I give in this formate 4/2/2020
If I give 5 minutes or even once a week if working
can anyone help me how to give time and specified date
Since schedule(when, name, [data]) as per the documentation
[s]chedules a job to run name once at a given time. when can be a Date or a String such as tomorrow at 5pm.
You need to provide a Date object instead of String.
The way to do it as per Date MDN documentation is new Date(2020, 1, 4) (assuming you meant February and not April) so your line could be:
agenda.schedule(new Date(2020, 1, 4), 'say hello');

How to parse this time string with Datatables and moment.js?

So I'm using datatables and their moment.js plugin (https://datatables.net/plug-ins/dataRender/datetime). I always get (the string) "Invalid date" returned...
{ "data": "last_updated", //source: 2016-11-02 10:32pm GMT
render: $.fn.dataTable.render.moment( 'YY-MM-DD hh:mmtt GMT', 'DD MMM YY' )
}
Thanks!
That plugin takes one, two or three arguments. From testing it seems as though your date is valid so I'd suggest just passing "SS MMM YY" to the function. As a quick example this seems to work:
moment("2016-11-02 10:32pm GMT").format("DD MMM YY"); // "02 Nov 16"
Another issue might be that the date isn't set, so it's perhaps worth checking for nulls and setting some default content. In fact, if you've already got momentjs available you can replace the plugin with this as the render function:
"render": function(data){
return (moment(data).isValid()) ? moment(data).format("DD MMM YY") : "-";
}
Hope that helps.

Wsapi data store filter issues

I am having trouble to get my filter of a defect store working. I am trying to to get all the defect that are created after a specific date( Release.ReleaseDate ).
_getFilters: function(startDate) {
var dateFilter = Ext.create('Rally.data.wsapi.Filter', {
property: 'CreationDate',
operator: '>',
value: startDate
});
console.log('startDate is: ', startDate); //Sat Aug 23 2014 02:59:59 GMT-0400 (Eastern Daylight Time)
console.log(dateFilter.toString());
return dateFilter;
},
With the above filter, I always get an empty result, even thought I have verified that there are indeed some defects that are created after the startDate.
Note: If I remove the filter in the store config, I do see a list of defects.
Am I missing anything?
Thanks
The date has to be converted to ISO format. Assuming you got the release object:
var releaseStartDate = release.get('ReleaseStartDate');
var releaseStartDateISO = Rally.util.DateTime.toIsoString(releaseStartDate,true);
your filter will include this:
{
property : 'CreationDate',
operator : '>',
value : releaseStartDateISO
}
A full example is in this github repo.
It turns out that I need to 'reformat' the startDate to the following form before passing it to the filter.
YYYY-MM-DD