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

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

There's definately a great

There's definately a great deal to learn about this topic.
I really like all of the points you made.

freight forwarding germany to

freight forwarding germany to usa - freight forwarder florida - freight forwarder fedex - freight forwarder vs motor carrier - freight forwarder flexport

freight forwarder kingsgrove

freight forwarder kingsgrove - freight forwarder business model - freight forwarder insurance - freight forwarder network - freight forwarder london

Hi! I know this is somewhat

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

freight forwarder switzerland

freight forwarder switzerland - freight forwarder manager salary - freight forwarder korea - freight forwarder quote - freight forwarder history

freight forwarder names -

freight forwarder names - freight forwarder quote online - freight forwarder us to canada - freight forwarder vs dhl - freight forwarder ireland

I do agree with all the

I do agree with all the concepts you have offered
for your post. They are very convincing and will definitely work.
Still, the posts are too short for beginners. Could you please prolong them a little
from subsequent time? Thanks for the post.

I all the time used to study

I all the time used to study piece of writing in news papers but now as I am
a user of web therefore from now I am using net for content,
thanks to web.

freight forwarder

freight forwarder massachusetts - freight forwarder montreal - freight forwarder quote - freight forwarder fedex - freight forwarder logistics

freight forwarder usa to

freight forwarder usa to india - freight forwarder for amazon - freight forwarder vs logistics - freight forwarder database - freight forwarder vietnam

It's impressive that you are

It's impressive that you are getting thoughts from this post as well as from our argument made
at this time.

Simply want to say your

Simply want to say your article is as astounding.
The clearness in your post is just spectacular and i could assume you are
an expert on this subject. Fine with your permission let me to grab your feed to keep updated with forthcoming post.
Thanks a million and please keep up the enjoyable work.

freight forwarder questions -

freight forwarder questions - freight forwarder usa to india - freight forwarder sydney - freight forwarder in nepal - freight forwarder edinburgh

When I initially commented I

When I initially commented I appear to have clicked the -Notify me when new comments are added- checkbox
and now every time a comment is added I get four emails with the exact same comment.

Is there a means you are able to remove me from that service?

Thank you!

Howdy exceptional blog! Does

Howdy exceptional blog! Does running a blog like this require a
large amount of work? I've virtually no expertise in computer
programming however I had been hoping to start my own blog soon.
Anyway, if you have any recommendations or techniques for new blog owners please share.
I know this is off subject however I simply needed to ask.
Many thanks!

スーパーコピー腕時計ブランド専売店

スーパーコピー腕時計ブランド専売店

freight forwarder kota

freight forwarder kota kinabalu - freight forwarder wordpress theme - freight forwarder to uk - freight forwarder from china to nigeria - freight forwarder uk to australia

freight forwarder a-z -

freight forwarder a-z - freight forwarder maroc - freight forwarder guam - freight forwarder new york jobs - freight forwarders for thailand

freight forwarder south

freight forwarder south africa - freight forwarder new york jobs - freight forwarder greece - freight forwarder kuwait - freight forwarder felixstowe

I am curious to find out what

I am curious to find out what blog platform you happen to be working with?
I'm having some minor security issues with my latest blog and I would like to find something more
safeguarded. Do you have any recommendations?

Great post. I was checking

Great post. I was checking continuously this blog and
I am impressed! Very useful info specifically the last part :
) I care for such information a lot. I was seeking this
certain information for a very long time. Thank you and good luck.

freight forwarder vs dhl -

freight forwarder vs dhl - freight forwarder yellow pages - freight forwarder job description - freight forwarder hull - freight forwarder traduction

freight forwarder receipt -

freight forwarder receipt - freight forwarder online shopping - freight forwarder charlotte nc - freight forwarder great yarmouth - freight forwarder forum

A person essentially help to

A person essentially help to make severely posts I'd state.
This is the very first time I frequented your web page and to this point?
I amazed with the analysis you made to make this particular publish extraordinary.
Fantastic task!

freight forwarder yorkshire -

freight forwarder yorkshire - freight forwarder rotterdam - freight forwarder export - freight forwarder venezuela - freight forwarder licence

I’ve recently started a

I’ve recently started a site, the info you provide on this website has helped me greatly. Thank you for all of your time & work.

freight forwarder company -

freight forwarder company - freight forwarder charleston sc - freight forwarder thailand list - freight forwarder trinidad - freight forwarder philadelphia

freight forwarder terms and

freight forwarder terms and conditions - freight forwarder richmond bc - freight forwarder kingston jamaica - freight forwarder world ranking - freight forwarder wage

freight forwarder

freight forwarder certification - freight forwarder contract - freight forwarder from china to singapore - freight forwarder education - freight forwarder to hawaii

This is the right webpage for

This is the right webpage for anyone who wants to understand this topic.
You realize so much its almost tough to argue with you (not that I personally will need to…HaHa).

You certainly put a new spin on a topic which has been written about for decades.

Great stuff, just excellent!

freight forwarder

freight forwarder christchurch - freight forwarder yellow pages - sky freight forwarders yanbu - freight forwarder boston - freight forwarder usa to thailand

Hello to every body, it's my

Hello to every body, it's my first go to see of this website; this blog consists of remarkable and truly good stuff
designed for readers.

freight forwarder brazil -

freight forwarder brazil - freight forwarder warehouse - freight forwarder australia - freight forwarder examples - freight forwarder license

Hello, all is going fine here

Hello, all is going fine here and ofcourse every one is sharing facts,
that's in fact good, keep up writing.

freight forwarder england -

freight forwarder england - freight forwarder nashville tn - freight forwarder lien - freight forwarder new york - freight forwarder bond

I will immediately snatch

I will immediately snatch your rss as I can not to find your e-mail subscription hyperlink or e-newsletter service.
Do you've any? Kindly permit me recognize so that
I could subscribe. Thanks.

freight forwarder uk -

freight forwarder uk - freight forwarder expeditors - freight forwarder usa - freight forwarder pdf - freight forwarder alexandria

freight forwarder us to

freight forwarder us to australia - freight forwarder in zhejiang - freight forwarder penang - freight forwarder us - freight forwarder geelong

freight forwarder

freight forwarder qualifications - freight forwarder ranking - freight forwarders south yorkshire - freight forwarder germany - freight forwarder wisconsin

It's remarkable to pay a

It's remarkable to pay a quick visit this website and reading the
views of all colleagues on the topic of this paragraph,
while I am also eager of getting knowledge.

I've been exploring for a bit

I've been exploring for a bit for any high quality articles or weblog posts in this kind of area .

Exploring in Yahoo I eventually stumbled upon this website.
Reading this info So i am satisfied to exhibit that I have a very excellent uncanny feeling I discovered just what
I needed. I such a lot indisputably will make sure to do not fail to remember this site and give it a glance regularly.

Please let me know if you're

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

You have some really good posts and I think 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 blast me an e-mail if interested.
Many thanks!

I wanted to thank you for

I wanted to thank you for this good read!! I absolutely loved every bit
of it. I've got you book-marked to look at new stuff you post…

Howdy! This is kind of off

Howdy! This is kind of off topic but I need some advice from
an established blog. Is it hard to set up your own blog?
I'm not very techincal but I can figure things
out pretty quick. I'm thinking about making my own but I'm not sure
where to start. Do you have any ideas or suggestions?
Thank you

freight forwarder new york

freight forwarder new york city - freight forwarder to mexico - freight forwarder website - freight forwarder and courier - freight forwarder documents needed

freight forwarder in zhejiang

freight forwarder in zhejiang - freight forwarder mississauga - freight forwarder uk to singapore - freight forwarder vs shipper - freight forwarder for amazon fba

I visited various web sites

I visited various web sites except the audio quality for audio songs
existing at this site is genuinely fabulous.

freight forwarders in yemen -

freight forwarders in yemen - famous freight forwarding (thailand) co. ltd - freight forwarder dhl - freight forwarder quotation sample - freight forwarder pdf

Usually I do not learn

Usually I do not learn article on blogs, however I would like
to say that this write-up very forced me to try and do so!
Your writing taste has been amazed me. Thank you, very nice post.

freight forwarder average

freight forwarder average salary - freight forwarder jobs in karachi - freight forwarder oakland - freight forwarder - freight forwarder hawaii

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.