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

teamhelvoirt-nl.

js-pcb. sodeistvieomsk.

catalinchiru. amiyalee.

I seriously love your site..

I seriously love your site.. Great colors & theme. Did you create
this site yourself? Please reply back as I'm planning to
create my own website and would love to learn where you got this from or just what the theme is
called. Cheers!

I treasure the information on

I treasure the information on your websites. thnx!

Thank you for sharing this

Thank you for sharing this excellent web-site.

rayanwebhost. sunyudo.

smdservicesllc. mercury.

jabulaniholdings.

Hey! I just wanted to ask if

Hey! I just wanted to ask if you ever have any trouble with hackers?
My last blog (wordpress) was hacked and I ended
up losing many months of hard work due to no data backup.
Do you have any solutions to prevent hackers?

Feel free to surf to my webpage; Cialis online from us pharmacy

What's up, good internet site

What's up, good internet site you have got at this time there.

xn---1-6kcatagi3d.

clevio. kentside-rp.

Admiring the time and energy

Admiring the time and energy you put into your blog and detailed information you offer.
It's awesome to come across a blog every once in a while that isn't the
same unwanted rehashed material. Great read! I've bookmarked your
site and I'm including your RSS feeds to my Google account.

borsalino-verbier.

edu. steerhome.

xn---1-6kcatagi3d.

My brother suggested I would

My brother suggested I would possibly like this website. He was
entirely right. This post actually made my day. You cann't
believe just how much time I had spent for this info!

Thanks!

Have a look at my web-site :: Cialis soft tabs online pharmacy

You've gotten the most

You've gotten the most impressive sites.

Thanks with regard to

Thanks with regard to furnishing this sort of very good information.

infinity-october. 2atalk.

die-leichte-kocherei.

I know this if off topic but

I know this if off topic but I'm looking into starting my
own weblog and was curious what all is needed to get setup?
I'm assuming having a blog like yours would cost a pretty penny?
I'm not very internet smart so I'm not 100% positive.
Any recommendations or advice would be greatly appreciated.
Appreciate it

Feel free to visit my homepage ... dyson dc24

You've got the most

You've got the most impressive webpages.

kcwzz. catalinchiru.

smertforum. clevio. molweb.

Asking questions are truly

Asking questions are truly good thing if you are not
understanding something completely, except this piece of writing offers nice understanding yet.

kostakopoulos.

samsung. ysiaq. cresign.

It's remarkable to pay a

It's remarkable to pay a quick visit this web site and reading
the views of all friends concerning this paragraph, while I
am also zealous of getting knowledge.

Your material is amazingly

Your material is amazingly helpful.

ugeltacna. insidefilms.

florapos. s2slc. libresite.

catalinchiru.

What's up, I log on to your

What's up, I log on to your blogs on a regular
basis. Your humoristic style is awesome, keep doing what you're doing!

Many thanks, this site is

Many thanks, this site is very useful.

Good webpage you have got in

Good webpage you have got in here.

hihara1ana2joy9. badnas.

I do not know if it's just me

I do not know if it's just me or if everybody else experiencing issues with your website.
It seems like some of the written text on your posts are running off the screen. Can somebody else please provide feedback and let me know if
this is happening to them too? This might be a problem with my browser
because I've had this happen previously. Appreciate it

Look into my website dyson dc24

The posts is quite exciting.

The posts is quite exciting.

I enjoy this website - its so

I enjoy this website - its so usefull and helpfull.

jabulaniholdings. vatal.

peymankala. houseyorgrim.

If you desire to increase

If you desire to increase your familiarity simply keep visiting this web site and be updated
with the most recent news posted here.

Stop by my web blog - dyson replacement parts

Great web site! It looks

Great web site! It looks extremely expert! Keep up the great work!

stayhere. oneofakind327.

smertforum. clevio. molweb.

I love your blog.. very nice

I love your blog.. very nice colors & theme. Did you make
this website yourself or did you hire someone to do it for you?
Plz answer back as I'm looking to create my own blog and would like to find out where u got this from.
thanks

Here is my webpage - impotence remedy

ysiaq. die-leichte-kocherei.

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.