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

Valuable information.

Valuable information. Fortunate me I discovered your web site
accidentally, and I'm surprised why this coincidence did
not came about in advance! I bookmarked it.

I like the helpful info you

I like the helpful info you provide in your articles.
I will bookmark your blog and check again here frequently.
I am quite sure I'll learn lots of new stuff right here!
Good luck for the next!

Howdy this is kind of of off

Howdy this is kind of of off topic but I was wanting to know 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!

That is a really good tip

That is a really good tip particularly to those fresh to the blogosphere.
Simple but very accurate information… Thanks for sharing this one.
A must read article!

Excellent site you've got

Excellent site you've got here.. It's hard to find high-quality writing like yours nowadays.
I honestly appreciate people like you! Take care!!

Amazing! This blog looks

Amazing! This blog looks exactly like my old one! It's
on a totally different subject but it has pretty much the same layout and design. Superb choice of colors!

Hello there! I know this is

Hello there! I know this is kinda off topic but I'd figured I'd ask.
Would you be interested in exchanging links or maybe guest
authoring a blog article or vice-versa?
My website goes over a lot of the same subjects as yours and I believe we could greatly benefit
from each other. If you are interested feel free to shoot
me an e-mail. I look forward to hearing from you!
Fantastic blog by the way!

I'm really enjoying the

I'm really enjoying the design and layout of your website.
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?
Superb work!

Very energetic article, I

Very energetic article, I liked that bit. Will there be a part 2?

Great website. Lots of useful

Great website. Lots of useful information here.
I am sending it to some pals ans additionally sharing in delicious.
And of course, thank you to your sweat!

What a data of un-ambiguity

What a data of un-ambiguity and preserveness of precious
know-how about unexpected emotions.

Fine way of describing, and

Fine way of describing, and pleasant paragraph to obtain facts on the topic of
my presentation topic, which i am going to convey in institution of higher education.

Hey there would you mind

Hey there would you mind stating which blog platform you're working with?
I'm planning to start my own blog soon but I'm having a hard
time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design seems different then most blogs and I'm looking for something unique.
P.S Apologies for being off-topic but I had to ask!

I like the valuable info you

I like the valuable info you provide on your articles.
I will bookmark your weblog and test once more here regularly.

I am slightly certain I'll be informed many new stuff right here!
Best of luck for the following!

It's fantastic that you are

It's fantastic that you are getting ideas from this post as well as from our argument made here.

I do not know if it's just me

I do not know if it's just me or if perhaps
everybody else experiencing problems with your site.
It looks like some of the text in your content are running
off the screen. Can somebody else please provide feedback and let
me know if this is happening to them too? This may be a problem with my internet browser because
I've had this happen before. Thanks

Saved as a favorite, I like

Saved as a favorite, I like your blog!

Nice post. I was checking

Nice post. I was checking constantly this blog and I'm impressed!

Extremely useful information specifically the last part :) I care for such
information a lot. I was seeking this particular info for a long time.

Thank you and good luck.

This post will assist the

This post will assist the internet viewers for building up new webpage
or even a blog from start to end.

I think this is among the

I think this is among the such a lot vital info for me. And i am glad
reading your article. But wanna statement on some basic
things, The web site taste is wonderful, the articles is in point of fact nice :
D. Excellent task, cheers

It is appropriate time to

It is appropriate 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 desire to suggest you
few interesting things or suggestions. Perhaps you could write next articles referring
to this article. I want to read more things about it!

This paragraph is genuinely a

This paragraph is genuinely a fastidious one it helps new the web people, who
are wishing in favor of blogging.

Great blog here! Additionally

Great blog here! Additionally your website loads up fast!

What host are you using? Can I am getting your
affiliate hyperlink in your host? I want my web site loaded up as quickly as yours lol

Oh my goodness! Amazing

Oh my goodness! Amazing article dude! Thank you, However
I am going through issues with your RSS. I don't know the reason why I cannot subscribe to it.
Is there anybody getting identical RSS issues?
Anybody who knows the answer will you kindly respond?
Thanks!!

I am actually thankful to the

I am actually thankful to the holder of this web site who has shared this fantastic post at here.

It's enormous that you are

It's enormous that you are getting thoughts from this
post as well as from our discussion made here.

Hello! Do you know if they

Hello! Do you know if they make any plugins to help with Search Engine Optimization?
I'm trying to get my blog to rank for some targeted keywords but I'm not seeing
very good success. If you know of any please share. Appreciate it!

Hello, i believe that i saw

Hello, i believe that i saw you visited my website so i got here to return the desire?.I am attempting to to find issues to improve
my website!I suppose its ok to make use of a few of your
concepts!!

I was curious if you ever

I was curious if you ever thought of 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 2 images.
Maybe you could space it out better?

Hi, its fastidious piece of

Hi, its fastidious piece of writing on the topic of media print, we all be aware
of media is a impressive source of data.

I am in fact pleased to

I am in fact pleased to glance at this weblog posts which carries lots of valuable information, thanks for providing these kinds of information.|

Having read this I thought it

Having read this I thought it was extremely informative.
I appreciate you spending some time and energy to put this
article together. I once again find myself personally spending way too much time both reading and
commenting. But so what, it was still worth it!

Piece of writing writing is

Piece of writing writing is also a excitement, if you be familiar with afterward
you can write otherwise it is difficult to write.

Thanks , I have recently been

Thanks , I have recently been looking for info
approximately this subject for ages and yours is the best I have discovered so far.
However, what in regards to the conclusion? Are
you positive about the supply?

Hmm is anyone else

Hmm is anyone else experiencing problems with the pictures on this blog loading?

I'm trying to figure out if its a problem on my end
or if it's the blog. Any responses would be greatly appreciated.

Ahaa, its fastidious

Ahaa, its fastidious conversation about this piece of writing at this place
at this weblog, I have read all that, so at this
time me also commenting at this place.

Wow, awesome blog structure!

Wow, awesome blog structure! How long have you ever been running a blog for?
you made blogging glance easy. The total glance of your website is great, let alone the content material!

I'll immediately snatch your

I'll immediately snatch your rss feed as I can't find your email subscription link or newsletter service.
Do you have any? Kindly let me recognize so that I could subscribe.
Thanks.

Hi, I read your blog daily.

Hi, I read your blog daily. Your writing style is witty, keep it up!

I am really grateful to the

I am really grateful to the holder of this web page who has shared this enormous paragraph at at this place.

What a stuff of un-ambiguity

What a stuff of un-ambiguity and preserveness of precious familiarity about unpredicted emotions.

When someone writes an

When someone writes an article he/she retains the image of
a user in his/her mind that how a user can know it.

Therefore that's why this piece of writing is perfect.
Thanks!

Thanks in support of sharing

Thanks in support of sharing such a nice thought, piece of writing is fastidious, thats why i have
read it entirely

Marvelous, what a website it

Marvelous, what a website it is! This weblog gives helpful facts to us, keep it up.

I'm no longer sure the place

I'm no longer sure the place you're getting your info, but good topic.
I needs to spend a while studying much more or figuring
out more. Thank you for excellent information I
was looking for this info for my mission.

This is really interesting,

This is really interesting, You are a very skilled blogger.
I have joined your rss feed and look forward to seeking
more of your excellent post. Also, I have shared your
site in my social networks!

Asking questions are actually

Asking questions are actually good thing if you are not understanding anything
fully, but this piece of writing gives pleasant understanding even.

Keep this going please, great

Keep this going please, great job!

Thanks for a marvelous

Thanks for a marvelous posting! I genuinely enjoyed reading
it, you could be a great author.I will make certain to bookmark
your blog and will come back later on. I want to encourage you to continue your great posts,
have a nice weekend!

What's up mates, pleasant

What's up mates, pleasant post and pleasant urging commented at
this place, I am genuinely enjoying by these.

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.