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

Thanks for sharing your

Thanks for sharing your thoughts about %meta_keyword%. Regards|

Thanks a bunch for sharing

Thanks a bunch for sharing this with all people you actually recognize what you're speaking approximately! Bookmarked. Please also talk over with my site =). We could have a link exchange agreement between us|

An intriguing discussion is

An intriguing discussion is definitely worth comment. I believe that you should publish more about this issue, it might not be a taboo subject but usually people don't speak about these subjects. To the next! Best wishes!!|

Thanks for a marvelous

Thanks for a marvelous posting! I truly enjoyed reading it, you're a great author. I will ensure that I bookmark your blog and will come back in the foreseeable future. I want to encourage yourself to continue your great work, have a nice evening!|

Hi! Quick question that's

Hi! Quick question that's totally off topic. Do you know
how to make your site mobile friendly? My weblog looks weird when viewing from my iphone4.
I'm trying to find a template or plugin that might be able to
fix this problem. If you have any suggestions, please share.
Thank you!

{

{

Thank you for the good

Thank you for the good writeup. It in fact was a amusement account it. Look advanced to more added agreeable from you! However, how could we communicate?|

I simply could not leave your

I simply could not leave your site prior to suggesting that I extremely
enjoyed the standard information an individual provide to your guests?
Is going to be again incessantly in order to inspect new posts

It's in point of fact a nice

It's in point of fact a nice and helpful piece of info. I'm happy that you simply shared this useful info with us. Please keep us up to date like this. Thanks for sharing.|

These are really impressive

These are really impressive ideas in concerning blogging.
You have touched some fastidious points here.

Any way keep up wrinting.

Nice post. I learn something

Nice post. I learn something new and challenging on sites I stumbleupon every day. It's always useful to read articles from other authors and use something from other sites. |

I have read so many posts

I have read so many posts concerning the blogger lovers except this article is in fact a nice post, keep it up.|

I will right away snatch your

I will right away snatch your rss as I can't in finding your e-mail subscription hyperlink or newsletter service. Do you have any? Please allow me understand so that I may just subscribe. Thanks.|

Hello my friend! I wish to

Hello my friend! I wish to say that this post is amazing, great written and include almost all vital infos. I would like to see more posts like this .|

If some one desires expert

If some one desires expert view concerning blogging
and site-building afterward i suggest him/her to visit this web site, Keep up the good work.

Thank you for the auspicious

Thank you for the auspicious writeup. It in reality used to be a amusement account it. Look complicated to more introduced agreeable from you! By the way, how could we keep in touch?|

I was wondering if you ever

I was wondering if you ever thought of changing the layout of your website? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having one or 2 images. Maybe you could space it out better?|

WOW just what I was looking

WOW just what I was looking for. Came here by searching for %meta_keyword%|

I have to thank you for the

I have to thank you for the efforts you've put in writing this website.
I'm hoping to view the same high-grade blog posts from you later on as well.
In truth, your creative writing abilities has motivated me
to get my own site now ;)

Hello, after reading this

Hello, after reading this amazing article i am as well delighted to share my familiarity here with mates.|

It's great that you are

It's great that you are getting ideas from this piece of writing as well as from our argument made at this place.|

Great post.|

Great post.|

Wow that was odd. I just

Wow that was odd. I just wrote an incredibly long comment but after I clicked submit my comment didn't show up. Grrrr... well I'm not writing all that over again. Anyway, just wanted to say wonderful blog!|

Fantastic beat ! I would like

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

Hello, i think that i saw you

Hello, i think that i saw you visited my web site so i came to go back the favor?.I am trying to to find issues to enhance my website!I guess its good enough to make use of a few of your concepts!!|

Heya i'm for the first time

Heya i'm for the first time here. I came across this board and I to find It truly helpful & it helped me out a lot. I hope to provide one thing again and help others like you aided me.|

I do believe all the ideas

I do believe all the ideas you have introduced to your post. They're very convincing and will definitely work. Nonetheless, the posts are very brief for novices. May just you please lengthen them a little from next time? Thanks for the post.|

Great post. I was checking

Great post. I was checking constantly this blog and I'm impressed! Very helpful info specifically the final part :) I maintain such info a lot. I was seeking this particular information for a long time. Thank you and good luck. |

Nice response in return of

Nice response in return of this matter with genuine arguments and describing the whole thing on the topic of that.|

Pcb Box Build Assembly

If you wish for to get a

If you wish for to get a great deal from this piece of writing then you have to apply such methods to your won weblog.|

You actually make it seem so

You actually make it seem so easy with your presentation but I find this matter to be really something that I think I would never understand. It seems too complicated and extremely broad for me. I am looking forward for your next post, I'll try to get the hang of it!|

Hmm is anyone else

Hmm is anyone else encountering problems with the pictures on this blog loading? I'm trying to determine if its a problem on my end or if it's the blog. Any responses would be greatly appreciated.|

You ought to be a part of a

You ought to be a part of a contest for one of the most useful sites on the internet. I'm going to highly recommend this site!|

Spot on with this write-up, I

Spot on with this write-up, I actually feel this amazing site needs far more attention. I'll probably be returning to see more, thanks for the information!|

Hello There. I discovered

Hello There. I discovered your blog the usage of msn. This is a very smartly written article. I will be sure to bookmark it and come back to read more of your helpful information. Thanks for the post. I'll certainly return.|

Woah! I'm really enjoying the

Woah! I'm really enjoying the template/theme of this blog. It's simple, yet effective. A lot of times it's very difficult to get that "perfect balance" between superb usability and appearance. I must say that you've done a very good job with this. Additionally, the blog loads very fast for me on Chrome. Superb Blog!|

Hey! I could have sworn I've

Hey! I could have sworn I've been to this blog before but after browsing through some of the post I realized it's new to me. Anyways, I'm definitely glad I found it and I'll be book-marking and checking back often!|

First of all I would like to

First of all I would like to say awesome blog! I had a quick question in which I'd like to ask if you do not mind. I was interested to know how you center yourself and clear your thoughts prior to writing. I have had trouble clearing my thoughts in getting my ideas out. I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes are generally lost just trying to figure out how to begin. Any suggestions or tips? Thank you!|

I was curious if you ever

I was curious if you ever considered changing the structure of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two images. Maybe you could space it out better?|

Fantastic web site. Lots of

Fantastic web site. Lots of helpful info here. I'm sending it to several buddies ans also sharing in delicious. And naturally, thanks in your sweat!|

Hmm is anyone else

Hmm is anyone else encountering problems with the pictures on this blog loading? I'm trying to find out if its a problem on my end or if it's the blog. Any responses would be greatly appreciated.|

Thanks for every other

Thanks for every other excellent post. The place else may just anybody get that type of info in such an ideal manner of writing? I have a presentation next week, and I'm at the look for such information.|

When someone writes an post

When someone writes an post he/she keeps the idea of a user in his/her mind that how a user can know it. Therefore that's why this post is perfect. Thanks!|

This is the right webpage for

This is the right webpage for anybody who hopes to understand this topic. You realize a whole lot its almost hard to argue with you (not that I really would want to…HaHa). You definitely put a brand new spin on a subject that has been discussed for years. Wonderful stuff, just wonderful!|

When some one searches for

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

Thanks to my father who

Thanks to my father who informed me concerning this blog, this web site is actually remarkable.|

What i don't realize is if

What i don't realize is if truth be told how you're no longer actually much more well-liked than you may be right now. You are very intelligent. You realize thus considerably in terms of this matter, made me in my view consider it from so many various angles. Its like women and men aren't fascinated except it's something to accomplish with Lady gaga! Your personal stuffs nice. Always take care of it up!|

Wow, this piece of writing is

Wow, this piece of writing is pleasant, my younger sister is analyzing these things, so I am going to convey her.|

This information is

This information is priceless. When can I find out more?|

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.