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.
Related
I'm using the blog app of 2sxc DNN module.
It already has querystring by author and tags, i was wondering if it would be possible todo one with PublicationMoment with Year only.
I only want to show post by year, so thought doing a query string would be helpful
(example: xxxx/blog/?PublicationMoment=2015), however in visualquery i don't know how to go about it, as QueryString is through a relationship filter by Entity not by attribute.
Anyhelp in this regard would be helpful
I think this should be easy... here's how you can start going on about it...
While you're experimenting, please create a completely new query which only queries this. You need this, because you'll be tinkering around a bit and you want to be sure you're not confusing yourself with other parts of the query.
You should be able to create a value-filter where the publication-moment between and then date1 and date2. While tinkering, I suggest you really do a 2016-01-01 and 2017-01-01. once that works, start replacing the static values 2016-01-01 with [QueryString:Start] or with [QueryString:Year]-01-01....then build on that.
ok?
This date format 2016-04-21 is stored in the database, but it's display like 21.04.2014. on my website. This is very frustrating.
Solution echo $object->field->format('Y-m-d'); is not good for me.
I would like to define settings that this is not happening anymore.
Sorry for my english.
Use this
$date="2016-04-21";
$require_date_format = date('d.m.Y', strtotime($date));//will out put 21.04.2016
I am working on an arabic language support project using smartclient 10.0.
It requires an arabic(hijri) calendar support for date picker component.
How can I add arabic(hijri) calendar for date picker component in smartclient?
I suppose you want to define month names in arabic, and maybe the picker grid to be ordered in another way. Then you will need to extend the DateItem for DynamicForm. Check here: http://www.smartclient.com/docs/10.0/a/b/c/go.html#class..Class
http://www.smartclient.com/docs/10.0/a/b/c/go.html#object..ClassFactory
If that is not the case, and you just need to define the order of days, months, years according to arabic specifics, please check here:
http://www.smartclient.com/docs/10.0/a/b/c/go.html#type..DateInputFormat
http://www.smartclient.com/docs/10.0/a/b/c/go.html#type..DateDisplayFormat
Also take a look here:
http://www.smartclient.com/docs/10.0/a/b/c/go.html#group..i18n
Hope this helps.
I currently have a problem with Dojo's calendar. It doesn't seem to be showing the name of the month when the locale is switched to zh-tw.
Instead of getting:
一月
二月
三月
。。。
we get
1
2
3
...
We don't have this problem when Dojo the locale is set to en. This is somewhat related to https://bugs.dojotoolkit.org/ticket/10490.
Anyone have a clue as to how to fix this? :)
Thanks!
That's because they implemented it that way. You can look at the source code and see that the months are numbered. You can even compare it to the English version.
As far as I know there is no way to extend or override this, so you will have to extend the dijit.Calendar._MonthDropDown yourself and hardcode it (not that this is a best practice).
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.