How to specify date only in angular-bootstrap-datetimepicker - angularjs

It seems to insist on making you choose a time also. I went through the read me several times and I'm not seeing how to only do a date.
https://github.com/dalelotts/angular-bootstrap-datetimepicker

You need to set minView to day in the config datetimepicker-config="{'minView':'day'}". It restricts selection till that level. So, by making it day, we won't let it select further days. Like this:
<datetimepicker ng-model="date" datetimepicker-config="{'minView':'day'}" />
That should do it!

Related

Statsig issue with Before Time and After TIme

I need to configure Statsig flag to return true for 30 days, by setting from and to dates
I am using "check time and date" and I am trying to set before and after time. But its giving invalid error. Not sure what is the mistake. Please guide to resolve this issue
Statsig uses American formats for dates - so MM/DD/YYYY, and XX:XX AM/PM
I think the UI should have a datepicker which enforces this. Here's what mine looks like

How to format dates from server into JS

It might be a super simple solution, but I am struglling with it for a while now.
I am using angular.js and using input time.
The server returns the following date convention:
shiftStarted = "2017-01-17 19:55:11"
I want to put it as ng-model in the input field:
<input type="time" ng-model="shiftStarted" />
The problem is that input time should receive a valid JS date format,
In order to try to solve it I used this solution I found on the web:
shiftStarted = new Date(shiftStarted.replace(' ', 'T'));
But the following is changing the timezone to UTC.
How can I simply put the date accurately in the input time field without handling tough timezone issues?
Best,
Omri
If your date has been formatted as YYYY-MM-DD, the browser will parse it as an ISO date. (the full format would be 2017-01-17T18:03:26+00:00 at the time of me writing this)
Since no timezone portion was provided (only a date), the browser assumes the timezone is UTC by default.
If you just want to parse a date without bothering with timezones, you could use MomentJS (as suggested by Ananth)
Code would be:
shiftStarted = moment(shiftStarted, "YYYY-MM-DD").toDate();
There is the angular-date directive:
<input type="text" datetime="yyyy-MM-dd HH:mm:ss" ng-model="shiftStarted">
This also include a parser service. New timezone additions too.
https://github.com/eight04/angular-datetime
You could try date.getTimezoneOffset()

How to properly format wordpress post date in ionic angularjs

I am working on a news blog mobile app using wordpress WP-API, everything else is working ok, but am having problem formatting the wordpress post date
this {{post.date}} gives me something like2016-08-07T15:45:26
How ever I want to format the date to have something like dd-mm-year, then in another one I get the time, instead of 15:45:26, I want to get something like 3:45 pm.
If possible, I will also like a filter that returns the date 2016-08-07T15:45:26 to something like 24 hours ago, 2 days ago, 1 week ago etc
Thanks
Had the same problem too. You may want to check this
:https://weblog.west-wind.com/posts/2014/jan/06/javascript-json-date-parsing-and-real-dates
You could use a date manipulation library to convert the datetime provided by WordPress to the desired format. You may want to check out Moment.js.

How to change x-axis datetime format in QlikView

First time Qlikview user here. Trying to get x-axis only showing the date from the timestamp. Here is the example,
It would be lovely to be able to remove the time. Does anybody know how to do this? I tried some simple script in the Used Dimension section under Dimension tab hoping to get only the date. It didn't work. It looked like this:
=date(floor(timestamp#(SomeDate,'MM/DD/YYYY hh:mm:ss'))) as record_date
Please help!
If you need to remove time than you rather use Date# function instead of timestamp#?
Below one is the sample one:-
Date#( DateField, 'M/D/YY')

How to set date to default time zone

I would like to set date to default time zone. At this moment my date looks like this: 2013-04-08T22:00:00 +02:00. I need to set my date to +00:00.
I tried to get the offset of my date and I received -120. Is it possible to set time offset? Are there maybe any better solutions?
Anybody an idea?
I'm using EXT JS.
JavaScript's Date object is bound to the time zone of the computer itself. There is no way to change the zone offset programmatically to an arbitrary value.
There is some work going on to add this functionality to the Moment.js library, but it is still in progress.
If you are just looking to get the time at UTC in ISO format, you can use .toISOString()
If you are speaking about code that is specific to the Ext.Date object from ExtJS, please edit your question and post some sample code so we can get a better idea of what you are talking about. Thanks.

Resources