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

order propecia online

order propecia online propecia canada zithromax zithromax online 20mg levitra levitra 20 generic cialis 20mg cialis online pastilla levitra generic levitra buy levothyroxine synthroid on line buy lasix furosemide buy online ixejil

Did you know that it’s

Did you know that it’s possible to make money testing video games?
You’re going to flip your lid when you see this http://j.gs/Brq4 Click
that link and start making money testing video games!

levitra 20mg levitra lasix to

levitra 20mg levitra lasix to buy online no prescription furosemide use levitra 20 mg levitra 20 mg dapoxetine online dapoxetine online vardenafil 20 mg vardenafil 20 mg prednisone 10 mg prednisone without dr prescription generic levitra 20 mg online levitra oewedtag

strattera strattera online

strattera strattera online canadian pharmacy cialis 20mg generic cialis canada pharmacy buy clomid buying clomid online levitra levitra tadalafil 20mg tadalafil 20mg on line pharmacy cialis canadian pharmacy oqadov

orlistat online xenical mail

orlistat online xenical mail order cialis cialis 20 mg best price doxycycline doxycycline 100mg propecia without prescription buy propecia ventolin hfa 90 mcg inhaler salbutamol inhalers retin a retin a micro buy diflucan online itraconazole ou fluconazole cialis disease 5mg cialis edajaqu

c3phbnRvZ2Fib3IuY29t

The health of your kidneys is

The health of your kidneys is very important. Take proper care of your kidneys by
following the information at http://destyy.com/wXQp2f You’ll never think of kidney health the same after visiting this site.

prednisone prednisone 20 mg

prednisone prednisone 20 mg cialis tablets priligy with cialis in usa lasix without prescription lasix no prescription levitra on line low cost levitra 20 mg pharmacy pharmacy online obudij

c3phbnRvZ2Fib3IuY29t

Genuinely no matter if

Genuinely no matter if someone doesn't be
aware of after that its up to other visitors that they will
assist, so here it occurs.

c3phbnRvZ2Fib3IuY29t

generic cialis canada

generic cialis canada pharmacy cialis online canada pharmacy online pharmacy online pharmacy buy propecia propecia doxycycline hyclate 100 mg doxycycline 100 mg generic cialis canada pharmacy northwest pharmacy canada ejalinkaw

Have you been wanting to get

Have you been wanting to get into the world of drop shipping,
but didn’t know where to start? This guide http://destyy.com/wXm77T will
show you how to get started. It’ll teach you where to buy all the stuff that can be
sold for super high profits.

zoloft buy buy sertraline

zoloft buy buy sertraline cialis online canada cialis online canada propecia uk propecia propecia generic buy propecia cialis discount cialis aemiyob

online prednisone online

online prednisone online prednisone with no prescription amoxicillin online amoxicillin generic cialis cialis 20mg cialis 20 mg cialis prednisone 10 mg tablet prednisone 20 mg ejujofa

Hello would you mind letting

Hello would you mind letting me know which hosting company
you're using? I've loaded your blog in 3 different web browsers and I must say this
blog loads a lot faster then most. Can you recommend a good web hosting
provider at a honest price? Cheers, I appreciate it!

tadalafil 20 mg tadalafil

tadalafil 20 mg tadalafil 20mg lowest price amoxicillin 500mg amoxicillin cialis cialis erection photos amoxicillin without prescription amoxicillin online order prednisone online prednisone for dogs tadalafil 20mg cialis cialis purchase cialis tadalafil 20 mg canadian pharmacy cialis canadian pharmacy online ciprofloxacin 500 mg ciprofloxacin 500 mg imipubaxa

ciprofloxacin 500mg cipro

ciprofloxacin 500mg cipro tendons bayer levitra samples levitra coupon pharmacy pharmacy buy ventolin inhaler salbutamol inhaler azithromycin 250 mg zithromax online order levitra levitra prices ediliolam

levitra 20mg information

levitra 20mg information purchase levitra cialis cialis buy cialis online pharmacy generic cialis canada pharmacy cialis pills cialis 20 mg amoxicillin 500mg capsules for sale amoxicillin 500 mg to buy metronidazole 500mg antibiotic flagyl on line buy furosemide online buy furosemide olemulaf

doxycycline 100mg doxycycline

doxycycline 100mg doxycycline 100 mg cialis 20mg price cialis on line generic levitra vardenafil buy levitra generic cialis 20 mg tablets cialis buy priligy online priligy dapoxetine obezot

c3phbnRvZ2Fib3IuY29t

buy celebrex no prescription

buy celebrex no prescription celebrex vardenafil generic buy levitra discount levitra levitra generic cialis tadalafil 20mg sildenafil vs vardenafil levitra online is levitra safe is levitra safe lasix lasix no prescription amoxicillin generic amoxicillin 500 mg ovxopem

cytotec pills cytotec online

cytotec pills cytotec online buy generic cialis generic tadalafil buy cialis generic cialis 20 mg generic cialis generic cialis lowest price cialis online cialis online cialis 20 mg lowest price cialis dosage 20mg online pharmacy cialis canadian pharmacy priligy dapoxetine priligy dapoxetine ukisani

buy lasix lasix sertraline

buy lasix lasix sertraline picture of zoloft propecia buy propecia levitra levitra buy propecia online propecia tadalafil 20mg buy cialis coupon levitra levitra 20 mg walmart canada pharmacy canadian pharmacy online azithromycin 250 mg order zithromax ojawoal

c3phbnRvZ2Fib3IuY29t

best price levitra 20 mg

best price levitra 20 mg levitra prices propecia online propecia online generic nexium nexium 40 mg price propecia pharmacy online pharmacy purchase levitra levitra voucher omoepoju

amoxicillin without

amoxicillin without prescription amoxicillin 500 mg sky pharmacy pharmacy online zithromax pharmacy antibiotics azithromycin buy xenical orlistat online levitra 20 mg levitra online uwosira

c3phbnRvZ2Fib3IuY29t

buy propecia online propecia

buy propecia online propecia online can i get salbutamol in mexico buy ventolin on line vente levitra levitra order online generic cialis 20 mg tablets cialis without prescription generic cialis at walmart cialis online uk doxycycline online doxycycline 100mg tablet cialis cialis canada levitra generic 20 mg buying levitra online furosemide without prescription buy lasix ueqivu

levitra levitra 20mg best

levitra levitra 20mg best price celebrex generic celebrex 200 mg cialis coupon generic tadalafil canada salbutamol inhalers ventolin online lasix lasix online oqexic

c3phbnRvZ2Fib3IuY29t

buycialisonlinecanada.org buy

buycialisonlinecanada.org buy cialis without prescription dapoxetine online buy dapoxetine online tadalafil cialis 5 mg best price usa levitra and tinnis generic levitra prednisone without an rx prednisone without prescription cialis without prescription cialis flagyl metronidazole 500mg antibiotic idoifub

propecia without prescription

propecia without prescription generic propecia uk online pharmacy no prescription on line pharmacy canine lasix doseage dosage lasix cialis cialis tablets overnight generic cialis cialis uwesuhef

retin a wrinkles tretinoin

retin a wrinkles tretinoin cream canada cialis 20 mg price cialis generic canada amoxicillin 500mg capsules amoxicillin 500mg cytotec buy buy misoprostol online buy prednisone buy prednisone azithromycin 250 mg azithromycin 250 mg cialis price cialis 20 mg ixekias

c3phbnRvZ2Fib3IuY29t

generic cialis canadian

generic cialis canadian pharmacy canada pharmacy online no script canadapharmacy.com buy cialis online pharmacy levitra 20 mg uso de levitra cialis canada generic cialis cialis coupon generic cialis tadalafil 20mg cialis cialis coupon otodem

c3phbnRvZ2Fib3IuY29t

canadian cialis generic

canadian cialis generic tadalafil 20mg propecia buy propecia studies how do cialis work how much cialis can you take pharmacy pharmacy cialis lowest price cialis aycubkkev

cialis dosage 20mg cialis

c3phbnRvZ2Fib3IuY29t

topamax online topamax online

topamax online topamax online essay essay essay writing essay writing service cialis cialis cialis coupons for pharmacy canadian pharmacy ceeaakie

online pharmacy online

online pharmacy online pharmacy canadian pharmacy sky pharmacy order doxycycline online doxycycline money loans money loans personal loans for people with bad credit cash advance online critical analysis essay write an argumentative essay ehisuexiy

c3phbnRvZ2Fib3IuY29t

zoloft 50 mg birth defects

zoloft 50 mg birth defects zoloft levitraonline levitra price essays about yourself essays about yourself payday advance direct payday lenders personal loans bad credit payday loans online payday loans easy money loans ivenil

essay setup process analysis

essay setup process analysis essay instant payday loans where can i get a loan with bad credit zoloft 50 zoloft 50mg zoloft buy zoloft cialis 20 mg lowest price cialis online psychology essay custom writings loan online payday advance loans unsecured loans payday loans ubuquto

quick cash quick loan levitra

quick cash quick loan levitra generic levitra payday loans fast cash loans persuasive speech essays persuasive essays cialis online tadalafil 20 mg career goals essay writing help evariop

argumentative essays

argumentative essays rhetorical analysis essay poor credit loans poor credit loans zoloft online zoloft side direct payday lenders direct payday lenders no credit loans pay day loans online bad credit personal loans loan places oxolacac

cialis cialis online essays

cialis cialis online essays rhetorical analysis essay amoxicillin on line amoxicillin for sale direct lenders payday loans cash advance online tadalafil 20mg lowest price cialis guaranteed loans loan companies nimitizal

spanish essay essay help with

spanish essay essay help with college essay writing persuasive essay buy propecia online buy propecia online payday loans direct lender need cash now payday loans pay day loans apaxoh

cialis cialis online money

cialis cialis online money fast no credit check personal loans prednisone 20mg prednisone 20 mg payday loans instant cash advance prednisone no prescription prednisone kamagra kamagra in canada loans for bad credit loans for bad credit gofisea

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.