Here's the problem with my datepickers.I tried three approaches which ultimately gave same wrong result.
Input type date:
<input type="date" ng-model="d.e_date" class="date"/>
Result: returned 2016-03-31 on choosing 1 April 2016 and 2016-04-06 on choosing 7April 2016.(One Day Back)
UI Bootstrap's datepicker and Jquery's datepicker:
Result: they also gave same result for format "yyyy/MM/dd".while i used them with format "MM/yyyy" and they returned 12/2013 on choosing January 2014 and 11/2015 on choosing December 2015.
Conclusion: As far as i could understand,it is somehow subtracting one point.like one day back in full date format and one month back in month's format.
datepicker date off by one day
This is the link i checked and also tried replacing "-" with "/" as mentioned in above post but no luck.
Update:
I am actually getting this date value in Angular controller and sending it to server.In Controller date is returned in "Thu Apr 01 2010 00:00:00 GMT+0500" on choosing 1st april 2010 while when its is submitted to service as
console.log($scope.s_month);// returns this Thu Apr 01 2010 00:00:00 GMT+0500
Restangular.all("s_session/create").post({s_month:$scope.s_month}).then(function(response){
console.log(response);
});//returns '2010-03-31T19:00:00.000Z' according to browser's network tab.
Related
db.collection.insertMany({_id:123, name:"abc", loc:"Delhi", YOB:new Date("1991-08-17")}, {_id:124, name:"def", loc:"Bengaluru", YOB:Date("1996-03-08")})
I want to change date format from new Date to Date in first document. How to change a specific field from a specific document like this?
I tried to change the date value from New Date format i.e., ISODate("1991-08-17T00:00:00:000Z") to Date format i.e., Mon Aug 17 2022 03:19:39 GMT+0530 (India Standard Time)
Can anyone help me out?
I have this angularJS view that I want to render a date with this format: MMM YYYY
My data is giving me the modified date as a string like "20210410072612"
I have:
{{item.default['Date modified'].substr(4,2) | date:'MMM'}} {{item.default['Date modified'].substr(0,4)}}
The results from this are: Jan 2021
The correct result should be Apr 2021 since when I remove the date:'MMM' filter I got 04 2021 Any idea what I'm doing wrong?
I manage to accomplish the desired results creating my own filter as a function and call it like this.
{{ getMonthName( item.default['Date modified'].substr(4,2) ) }} {{item.default['Date modified'].substr(0,4)}}
The issue was that I was passing a string with the zero for the month number and the result would always be Jan
I basically want to be able to dynamically filter out my chart to display data for the last 6 months. For example, it would show Jan 2019 to June 2019 and in July it would show between Feb 2019 to July 2019
Presently, I'm using filters. I was thinking of creating a calculated field for the 6 months but there are no functions to help me play with dates.
In the date-picker options, choose the one at the very bottom of the list which is called Advanced. Click on the end date option and where it says 'fixed' click and choose today. Do the same for the start date and you get the option to enter your conditions, which in this case would be today minus 6 months
I have an excel file in which the dob column contains entry of this type Thu Aug 04 00:00:00 BST 1983. I am trying to import the excel file in SQL-Server therefore I want to convert it to YYYY-MM-DD type. I tried the format cells option but it is not working. Any simple way of doing it or do I have to find regex for it?
Here is the sample file.
In case your string in excel is Thu Aug 04 00:00:00 BST 1983 with the same format, then you can try this:
Then goto Custom format cells and select Date first and then select Custom and type YYYY-MM-DD to get the desired format.
You can use Excel's DATE() function to do this. This takes year, month and day as values. There is some manipulation required to your date to get these values.
Please see below. 3rd row shows values: 30532 becomes 1983-08-04 when it is formatted (show formulae is on so you can see 2nd row)
I cant seem to figure out how to save a date coming from a date input field. Whenever I try submit, the date's format is pretty weird. It always goes something like this:
Wed Jun 17 2015 08:00:00 GMT+0800 (Taipei Standard Time)
and saving it on my DB gets messy. I need to use Carbon to make it work.
Is there a way to do save date from a Date Input Field flawlessly? If so, how?