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.
  • 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.
Kategória: 
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ó.

Hozzászólások

Hi there, You've performed a

Hi there, You've performed a fantastic job. I'll definitely digg it and individually suggest to my friends. I am sure they'll be benefited from this site.|

I love looking through an

I love looking through an article that will make people think.
Also, many thanks for allowing for me to comment!

Hi there, I wish for to

Hi there, I wish for to subscribe for this web site to obtain hottest updates, so where can i do it please help.|

Hello there! I could have

Hello there! I could have sworn I've been to this website
before but after reading through some of the post I realized it's new
to me. Nonetheless, I'm definitely happy I found it and I'll be book-marking and checking back
frequently!

whoah this blog is wonderful

whoah this blog is wonderful i like studying your articles.
Keep up the great work! You already know, many persons are looking around
for this info, you can aid them greatly.

Hi there, just wanted to say,

Hi there, just wanted to say, I liked this post. It was practical. Keep on posting!|

Asking questions are actually

Asking questions are actually pleasant thing if you are not understanding anything totally, but this piece of writing presents fastidious understanding even.|

Thank you, I've just been

Thank you, I've just been searching for information approximately this
topic for ages and yours is the best I have discovered so
far. But, what in regards to the bottom line?
Are you positive about the supply?

I like the valuable

I like the valuable information you provide to your articles. I will bookmark your blog and take a look at again right here frequently. I'm fairly certain I will learn many new stuff proper here! Best of luck for the following!|

Thank you, I have recently

Thank you, I have recently been searching for info about this subject for ages and yours is the best I have found out so far. However, what about the conclusion? Are you positive concerning the supply?|

Greetings! I know this is

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

Wonderful goods from you,

Wonderful goods from you, man. I have understand your stuff previous to and you are just too wonderful. I really like what you have acquired here, certainly like what you are stating and the way in which you say it. You make it entertaining and you still care for to keep it smart. I can not wait to read much more from you. This is really a great web site.|

It is in point of fact a nice

It is in point of fact a nice and helpful piece of info. I am satisfied that you simply shared this helpful info with us. Please keep us informed like this. Thanks for sharing.|

Excellent post. I was

Excellent post. I was checking continuously this blog and I am impressed! Extremely helpful info specially the ultimate section :) I maintain such info a lot. I was seeking this particular information for a very lengthy time. Thank you and best of luck. |

Excellent way of explaining,

Excellent way of explaining, and fastidious article to take data regarding my presentation subject,
which i am going to present in academy.

Hi! Do you know if they make

Hi! Do you know if they make any plugins to assist with SEO?
I'm trying to get my blog to rank for some targeted keywords but
I'm not seeing very good gains. If you know of
any please share. Cheers!

Excellent weblog here! Also

Excellent weblog here! Also your site loads up very fast! What web host are you the usage of? Can I am getting your associate link for your host? I wish my website loaded up as quickly as yours lol|

It's actually a nice and

It's actually a nice and useful piece of info. I am glad that you just
shared this useful info with us. Please stay us informed like this.
Thanks for sharing.

Acid And Alkali Vertical Pump

This is a topic that's close

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

With havin so much written

With havin so much written content do you ever run into any problems of plagorism or copyright infringement? My website has a lot of completely unique content I've either created myself or outsourced but it looks like a lot of it is popping it up all over the web without my permission. Do you know any techniques to help protect against content from being stolen? I'd truly appreciate it.|

I'm not sure why but this web

I'm not sure why but this web site is loading incredibly slow for me. Is anyone else having this problem or is it a problem on my end? I'll check back later and see if the problem still exists.|

Hi, I do think this is a

Hi, I do think this is a great blog. I stumbledupon it ;) I will revisit yet again since I bookmarked it. Money and freedom is the best way to change, may you be rich and continue to help others.|

Thanks for some other

Thanks for some other informative site. Where else could I am getting that
type of information written in such a perfect manner?

I've a venture that I am simply now operating on, and I've been on the glance out for such info.

I seriously love your blog..

I seriously love your blog.. Great colors & theme. Did you create this website yourself? Please reply back as I'm planning to create my own personal blog and want to know where you got this from or exactly what the theme is named. Cheers!|

This is my first time pay a

This is my first time pay a quick visit at here and i am actually impressed to read everthing at single place.|

Hello everyone, it's my first

Hello everyone, it's my first go to see at this web site, and article is in fact fruitful for me, keep up posting these content.|

What's up, this weekend is

What's up, this weekend is good in favor of me, for the reason that this occasion i am reading this wonderful educational article here at my home.|

Wow, incredible blog layout!

Wow, incredible blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is fantastic, as well as the content!|

I enjoy what you guys are up

I enjoy what you guys are up too. Such clever work and exposure! Keep up the very good works guys I've added you guys to our blogroll.|

whoah this blog is wonderful

whoah this blog is wonderful i like studying your articles. Stay up the good work! You realize, a lot of people are searching around for this info, you can aid them greatly. |

Yes! Finally someone writes

Yes! Finally someone writes about %keyword1%.|

Your means of explaining all

Your means of explaining all in this post is genuinely good, every one be able to easily know it, Thanks a lot.|

Hi, i think that i saw you

Hi, i think that i saw you visited my site thus i came to “return the favor”.I'm attempting to find things to improve my website!I suppose its ok to use some of your ideas!!|

Since the admin of this site

Since the admin of this site is working, no doubt very soon it will be well-known, due to its feature contents.|

Aw, this was an extremely

Aw, this was an extremely nice post. Taking a few minutes and actual effort to generate a good article… but what can I say… I hesitate a whole lot and don't seem to get nearly anything done.|

I needed to thank you for

I needed to thank you for this great read!! I certainly enjoyed every little bit of it. I have you book marked to look at new things you post…|

I just couldn't leave your

I just couldn't leave your site prior to suggesting that I actually enjoyed the usual info a person supply for your guests? Is going to be again ceaselessly to inspect new posts|

If you would like to increase

If you would like to increase your knowledge simply keep visiting this website and be updated with the most up-to-date news update posted here.|

Thanks for finally writing

Thanks for finally writing about >Válasz a hozzászólásra

Having read this I thought it

Having read this I thought it was very informative. I appreciate you finding the time and energy to put this article together. I once again find myself spending way too much time both reading and commenting. But so what, it was still worthwhile!|

Hmm it looks like your blog

Hmm it looks like your blog ate my first comment (it was extremely long) so I guess I'll just sum it up what I submitted and say, I'm thoroughly enjoying your blog. I too am an aspiring blog writer but I'm still new to everything. Do you have any suggestions for rookie blog writers? I'd genuinely appreciate it.|

Terrific article! This is the

Terrific article! This is the type of info that are meant to be shared around the internet. Shame on the search engines for no longer positioning this put up higher! Come on over and discuss with my website . Thanks =)|

As the admin of this web site

As the admin of this web site is working, no hesitation very quickly it will be famous, due to its feature contents.|

Pretty nice post. I just

Pretty nice post. I just stumbled upon your blog and wanted to say that I have truly enjoyed surfing around your blog posts. In any case I'll be subscribing to your feed and I hope you write again very soon!|

I think this is one of the

I think this is one of the most important information for me. And i'm glad reading your article. But should remark on few general things, The web site style is wonderful, the articles is really excellent : D. Good job, cheers|

I'm really enjoying the

I'm really enjoying the design and layout of your site.
It's a very easy on the eyes which makes it
much more pleasant for me to come here and visit more
often. Did you hire out a designer to create your theme?
Fantastic work!

Excellent web site you've got

Excellent web site you've got here.. It's hard to find excellent writing like yours these days. I seriously appreciate people like you! Take care!!|

An interesting discussion is

An interesting discussion is definitely worth comment. There's no doubt that that you need to publish more on this topic, it might not be a taboo matter but usually folks don't discuss these subjects. To the next! Kind regards!!|

When someone writes an

When someone writes an paragraph he/she keeps the thought of a user in his/her brain that how a user can understand it. So that's why this article is perfect. Thanks!|

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <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].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.