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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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

Hi! I know this is kinda off

Hi! I know this is kinda off topic but I was wondering which blog platform are you using for
this website? I'm getting sick and tired of Wordpress because I've
had problems with hackers and I'm looking
at alternatives for another platform. I would be awesome if
you could point me in the direction of a good platform.

Asking questions are

Asking questions are genuinely nice thing if you are not understanding
something totally, except this piece of writing gives pleasant understanding yet.

Hello to every body, it's my

Hello to every body, it's my first pay a visit of this webpage;
this blog carries remarkable and genuinely good material designed for visitors.

This is a topic that's close

This is a topic that's close to my heart... Thank you! Exactly where are your
contact details though?

Someone essentially lend a

Someone essentially lend a hand to make severely articles I would state.

This is the very first time I frequented your website page and thus far?

I surprised with the research you made to make this actual publish extraordinary.
Magnificent activity!

I'm gone to say to my little

I'm gone to say to my little brother, that he should also pay a visit this web site on regular basis to
get updated from most up-to-date information.

Amazing things here. I am

Amazing things here. I am very glad to see your
article. Thank you so much and I am having a look forward to touch
you. Will you please drop me a mail?

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 obviously know what youre talking about, why waste your intelligence on just posting videos to your site when you could be
giving us something informative to read?

When some one searches for

When some one searches for his required thing, thus he/she wishes to
be available that in detail, thus that thing is maintained over here.

Pretty nice post. I just

Pretty nice post. I just stumbled upon your blog and wanted to say that I have really enjoyed browsing your blog posts.

After all I'll be subscribing to your feed and I hope you write
again very soon!

well pattern

well pattern [url=http://cialisles.com/#]cialis online no prescription[/url] frequently hold across championship tadalafil 20 mg roughly entry cialis online no prescription cool system http://cialisles.com/

fantastic points altogether,

fantastic points altogether, you simply won a new reader.

What would you suggest about your post that you made
some days ago? Any certain?

What's up, the whole thing is

What's up, the whole thing is going nicely here and ofcourse every one is sharing information, that's truly fine, keep up writing.

Hi, i believe that i saw you

Hi, i believe that i saw you visited my weblog thus i
came to return the desire?.I'm trying to to find things to improve my web site!I suppose its ok to make use of
some of your ideas!!

less brain

less brain [url=http://cialissom.com/#]cialis 20 mg best price[/url]
how north cialis 20 mg best price clear bag readily role http://cialissom.com/# easily passion http://cialissom.com/

It is the best time to make

It is the best time to make some plans for
the future and it is time to be happy. I have read this post and if I could I wish to suggest
you few interesting things or suggestions. Maybe you
could write next articles referring to this article. I
desire to read even more things about it!

If you wish for to improve

If you wish for to improve your knowledge just keep visiting this website and be updated with the most recent news posted here.

Wow, this post is pleasant,

Wow, this post is pleasant, my sister is analyzing these things,
so I am going to tell her.

Quality articles is the

Quality articles is the crucial to invite the users to pay a quick visit the site, that's what this
site is providing.

Hi there to every body, it's

Hi there to every body, it's my first pay a quick visit
of this web site; this blog includes amazing and truly fine
stuff in support of readers.

For most recent information

For most recent information you have to pay a quick visit world wide web
and on internet I found this web site as a best website for hottest updates.

Hi, i think that i saw you

Hi, i think that i saw you visited my web site so i came
to “return the favor”.I'm trying to find things to enhance my web site!I suppose its ok to use some of your
ideas!!

My partner and I stumbled

My partner and I stumbled over here coming from a
different page and thought I should check things out.
I like what I see so now i'm following you. Look forward to
looking over your web page repeatedly.

I have been browsing online

I have been browsing online more than 2 hours today, yet
I never found any interesting article like yours. It's
pretty worth enough for me. In my view, if all web owners and bloggers made
good content as you did, the web will be much more useful than ever before.

Hello my family member! I

Hello my family member! I want to say that this post is awesome,
great written and come with almost all important infos.
I would like to peer more posts like this .

Excellent beat ! I would like

Excellent beat ! I would like to apprentice while you amend your web site, how could
i subscribe for a blog site? The account
aided me a acceptable deal. I had been a little bit
acquainted of this your broadcast offered bright clear concept

No matter if some one

No matter if some one searches for his required thing, thus he/she
needs to be available that in detail, therefore that thing is maintained over here.

Thanks very interesting blog!

Thanks very interesting blog!

I believe this is one of the

I believe this is one of the most significant information for me.
And i am satisfied reading your article. But should
remark on few common things, The site taste is perfect, the articles is actually
great : D. Excellent job, cheers

I love what you guys are up

I love what you guys are up too. This kind of clever work and reporting!
Keep up the superb works guys I've incorporated you guys to my personal blogroll.

Hey there, You've done a

Hey there, You've done a great job. I'll definitely digg it and personally recommend to my friends.
I am confident they'll be benefited from this site.

I don't even understand how I

I don't even understand how I ended up here, however I thought this post was great.
I do not understand who you might be however definitely you're going to a well-known blogger if you are not already.

Cheers!

Very quickly this website

Very quickly this website will be famous among all blogging and site-building viewers, due to it's nice posts

It's in point of fact a nice

It's in point of fact a nice and useful piece of info. I'm
satisfied that you just shared this helpful information with us.
Please keep us informed like this. Thanks for sharing.

Hi there! This is my first

Hi there! This is my first comment here so I
just wanted to give a quick shout out and say
I really enjoy reading through your posts. Can you suggest
any other blogs/websites/forums that go over the
same subjects? Thanks!

Hello colleagues, how is all,

Hello colleagues, how is all, and what you desire to say on the
topic of this article, in my view its actually amazing designed
for me.

We stumbled over here coming

We stumbled over here coming from a different page and thought
I should check things out. I like what I see so now i'm following you.
Look forward to looking over your web page yet again.

This is my first time pay a

This is my first time pay a visit at here and i am in fact pleassant to read
everthing at one place.

I'm now not positive where

I'm now not positive where you're getting your info, but great topic.
I must spend some time finding out more or figuring out more.
Thank you for magnificent info I used to be looking for
this information for my mission.

Heya! I'm at work surfing

Heya! I'm at work surfing around your blog from my new iphone!

Just wanted to say I love reading through your blog and look forward to
all your posts! Carry on the excellent work!

Hi! I just want to give you a

Hi! I just want to give you a huge thumbs up for your excellent info you have got
right here on this post. I will be coming back to your site
for more soon.

My brother suggested I might

My brother suggested I might like this blog.
He was entirely right. This post actually made my day.

You can not imagine simply how much time I had spent for this
information! Thanks!

Please let me know if you're

Please let me know if you're looking for a article author for your site.

You have some really great articles and I believe I would be
a good asset. If you ever want to take some of the load off, I'd
absolutely love to write some articles for your blog in exchange for a link back
to mine. Please shoot me an e-mail if interested.

Thank you!

It's an remarkable post for

It's an remarkable post for all the web people; they will
obtain benefit from it I am sure.

Appreciate this post. Will

Appreciate this post. Will try it out.

Great blog here! Also your

Great blog here! Also your web site loads up very
fast! What host are you using? Can I get your affiliate link to your
host? I wish my web site loaded up as fast as yours lol

Now I am going away to do my

Now I am going away to do my breakfast, once having my breakfast coming yet again to read further news.

Someone essentially assist to

Someone essentially assist to make significantly posts I would state.
This is the first time I frequented your website page and
thus far? I amazed with the analysis you made to make this particular submit incredible.
Magnificent process!

tadalafil approval europe

tadalafil approval europe [url=http://www.cialisoni.com/]online cialis[/url] unicure remedies pvt ltd tadalafil cialis
tadalafil tadalafil european pharmacopoeia monograph centurion tadalafil http://cialisoni.com/ tadalafil
kupie http://cialisoni.com/

Simply wish to say your

Simply wish to say your article is as astonishing. The clarity to your
publish is simply spectacular and i can think you're knowledgeable in this subject.
Well with your permission let me to snatch your RSS feed to stay
updated with coming near near post. Thanks one million and please continue
the gratifying work.

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.