I am trying to fetch an all-day calendar appointment from outlook using EWS.
I've set UTC timezone in the code:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013, TimeZoneInfo.Utc)
And I've set UTC in the outlook calendar settings:
Here is my appointment in outlook calendar:
Why does EWS return appointment with start date equals to 7:00 AM of 4th April and end date equals to 7:00 AM of 5th April?
Related
Below is my code where I need to display calendar with month and year and when user selects month and year it should display last day of that month with year. I am able to get the date as 01 June 2022 using below code, where as I need date as 30 June 2022
Quickest way is using a library like moment (depreacated) or dayjs. Take the date you get from datepicker, and use it with the library to get the end date of the month-year.
Change the dateInputFormat to YYYY-MM-DDDD in the bsConfig.
Inside your getDate() function process the datePicker date to get proper format.
Example code:
const date = '2022-06-01';
console.log('Print date: ', moment(date).endOf('month').format('DD MM YYYY'));
Result:
I have a report parameters start date and end date both set for previous day. I have report subscription that runs on each day of the week. But, when it executes on Monday, I need to change the Default parameter to run from the Prior Friday's date thru Sunday. How can I achieve this? TIA
I just replicated your use case locally.
For your start date parameter you will need expression as below. It will check if today is Friday (Weekday starts from Sunday) then set start date as Friday from last week else previous day. This shall work.
=IIF(WeekDay(today)=2,DateAdd("d",-3,today),DateAdd("d",-1,today))
I'm trying to get a Today vs This Day Last Year Comparison Report sorted.
I set a 'From' and 'To' date based on a 'Preset' parameter.
So if it is set to 'This Week' it sets the start date to Monday and the end date to Sunday.
What I want now is a Today vs This Day Last Year. So for example, if i were to do it for today, I would get 09/04/2015 vs 10/04/2014. So as today is Thursday, I want the nearest Thursday from 09/04/2014.
Also want the same for 'Yesterday'. So 08/04/2015 vs 09/04/2014
Is there a way to do this in either the Parameters SSRS expression, or within the custom 'Code' section?
To get this day last year, you can just subtract 52 weeks from today. Try this expression: =DateAdd("ww",-52,Today()). Likewise you can subtract 1 day from today to get yesterday: =DateAdd("d",-1,Today()).
I'm trying to create a query in google sheets that will pull data for the week so far. I can use the NDaysAgo filter to get the last 7 days but what I really need is from Monday to Sunday, and I don't want to have to go and edit the sheets every week. Also, if this can be done for weekly, I'd use the same formula for a month-to-date solution as well.
Thanks!
I am going to assume you are doing this in app Script.
Remember app script is just JavaScript. The following will return the previous Monday for a date.
var d = new Date();
var day = d.getDay(),
diff = d.getDate() - day + (day == 0 ? -6:1); // adjust if day is Sunday
Logger.log( new Date(d.setDate(diff)));
Use the getDay method of Date objects, you can find the number of the day of the week (being 0=Sunday, 1=Monday, etc).
You can then subtract that number of days plus one. result was:
[15-01-20 08:56:33:691 CET] Mon Jan 19 08:56:33 GMT+01:00 2015
I have a web page with a DatePicker control (from Kendo UI) on it.
Firstly, I'm in New Zealand, which is UTC +12:00
When I select a date of 31st October 2012 in my date picker, it gets stored in the JavaScript object as:
Wed Oct 31 00:00:00 UTC+1300 2012
This seems wrong!
It gets serialized to JSON (using JSON.stringify) as 2012-10-30T11:00:00.000Z, which is wrong.
Back on the server, when the JSON is parsed, this comes out at 30th October 2012, 23:00.
Can somebody explain this to me? And what is the solution?
I have this figured out now - the date picker control is working correctly, as for the date of October 31st, New Zealand will be in Daylight Savings Time, so at that date, we will be UTC +1300.
My problem is that my server code is converting to UTC on the basis of today's date, rather than using the offset as it would be on the the actual date.