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

If you are going for most

If you are going for most excellent contents like I do, only pay a visit this web page all the time for the reason that it provides feature contents, thanks|

You've made some really good

You've made some really good points there. I looked on the web for more information about the issue and found most individuals will go along with your views on this site.|

I just could not leave your

I just could not leave your site prior to suggesting that I extremely loved the standard information an individual provide on your visitors? Is going to be back regularly to investigate cross-check new posts|

Hello there! This post

Hello there! This post couldn't be written any better! Reading this post reminds me of my old room mate! He always kept chatting about this. I will forward this page to him. Pretty sure he will have a good read. Thanks for sharing!|

These are really wonderful

These are really wonderful ideas in concerning blogging. You have touched some fastidious points here. Any way keep up wrinting.|

Wonderful work! This is the

Wonderful work! This is the type of information that should be shared across the web. Disgrace on the seek engines for not positioning this submit higher! Come on over and discuss with my site . Thank you =)|

Hurrah, that's what I was

Hurrah, that's what I was looking for, what a material! existing here at this weblog, thanks admin of this web page.|

An impressive share! I have

An impressive share! I have just forwarded this onto a coworker who had been doing a little homework on this. And he actually bought me dinner simply because I discovered it for him... lol. So allow me to reword this.... Thanks for the meal!! But yeah, thanx for spending some time to discuss this subject here on your website.|

Hi, just wanted to mention, I

Hi, just wanted to mention, I enjoyed this blog post.

It was practical. Keep on posting!

magnificent points

magnificent points altogether, you just gained a logo new reader. What could you suggest in regards to your put up that you just made some days in the past? Any positive?|

My brother recommended I

My brother recommended I might like this website. He
was entirely right. This post truly made my day. You can not imagine simply how much time I had spent for this info!
Thanks!

I know this web site gives

I know this web site gives quality based posts and extra data, is there any other web page which presents these kinds of information in quality?|

Double Hold Pulling Riveting

Hey! Do you use Twitter? I'd

Hey! Do you use Twitter? I'd like to follow you if that would be okay. I'm absolutely enjoying your blog and look forward to new posts.|

Hi there! Do you know if they

Hi there! Do you know if they make any plugins to assist with Search Engine Optimization? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains. If you know of any please share. Kudos!|

each time i used to read

each time i used to read smaller posts that also clear their motive, and that is also happening with this post which I am reading now.|

I am genuinely grateful to

I am genuinely grateful to the holder of this web site who has shared this wonderful piece of writing at at this time.|

I was suggested this website

I was suggested this website via my cousin. I'm no longer sure whether this publish is written through him as nobody else understand such specific about my trouble. You are wonderful! Thanks!|

This is a topic that's near

This is a topic that's near to my heart... Best wishes!
Where are your contact details though?

Thank you for the auspicious

Thank you for the auspicious writeup. It in truth used to be a amusement account it. Look advanced to far introduced agreeable from you! By the way, how can we communicate?|

I am regular visitor, how are

I am regular visitor, how are you everybody? This post posted at this web page is genuinely nice.|

Greetings from Florida! I'm

Greetings from Florida! I'm bored to death at work so I decided to check out your
site on my iphone during lunch break. I enjoy the information you present here and can't wait
to take a look when I get home. I'm shocked at how fast your blog loaded on my phone ..

I'm not even using WIFI, just 3G .. Anyways, superb site!

Saved as a favorite, I like

Saved as a favorite, I like your web site!|

I am sure this piece of

I am sure this piece of writing has touched all the internet people, its really really fastidious piece of writing on building up new web site.|

Do you mind if I quote a few

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your site? My website is in the exact same area of interest as yours and my users would truly benefit from some of the information you provide here. Please let me know if this okay with you. Appreciate it!|

I'd like to find out more?

I'd like to find out more? I'd like to find out some additional information.|

Great blog! Is your theme

Great blog! Is your theme custom made or did you download it from somewhere? A theme like yours with a few simple tweeks would really make my blog shine. Please let me know where you got your theme. Thank you|

I was recommended this

I was recommended this website via my cousin.
I am now not sure whether or not this submit is written through him as no one
else recognise such designated approximately my
difficulty. You are incredible! Thanks!

Simply want to say your

Simply want to say your article is as surprising. The clearness on your submit is simply nice and i can think you're a professional in this subject. Well with your permission allow me to grasp your RSS feed to stay updated with approaching post. Thank you one million and please carry on the gratifying work.|

Hi there! Do you know if they

Hi there! Do you know if they make any plugins to protect against hackers? I'm kinda paranoid about losing everything I've worked hard on. Any tips?|

I read this piece of writing

I read this piece of writing fully concerning the difference of newest and preceding technologies, it's remarkable article.|

It is really a great and

It is really a great and helpful piece of info. I'm happy that you just shared this useful info with us. Please stay us informed like this. Thank you for sharing.|

Hey just wanted to give you a

Hey just wanted to give you a quick heads up. The text in your post seem to be running off the screen in Chrome. I'm not sure if this is a formatting issue or something to do with web browser compatibility but I figured I'd post to let you know. The style and design look great though! Hope you get the issue fixed soon. Kudos|

Do you have a spam issue on

Do you have a spam issue on this website; I also am a blogger, and
I was wondering your situation; we have created some nice methods and we
are looking to exchange methods with other folks, be sure to shoot me an email if interested.

You can definitely see your

You can definitely see your expertise within the work you write. The arena hopes for more passionate writers like you who are not afraid to say how they believe. Always follow your heart.|

Wonderful blog! Do you have

Wonderful blog! Do you have any hints for aspiring writers? I'm hoping to start my own website soon but I'm a little lost on everything. Would you propose starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I'm totally confused .. Any ideas? Thanks a lot!|

Hello, i think that i saw you

Hello, i think that i saw you visited my website so i came to “return the favor”.I'm attempting to find things to improve my site!I suppose its ok to use a few of your ideas!!|

Hello! This post could not be

Hello! This post could not be written any better! Reading through this post reminds me of my good old room mate! He always kept chatting about this. I will forward this page to him. Pretty sure he will have a good read. Thanks for sharing!|

Thanks for sharing such a

Thanks for sharing such a fastidious thought, paragraph is fastidious, thats why i have read it entirely|

I am not sure where you are

I am not sure where you are getting your info, but good topic. I needs to spend some time learning much more or understanding more. Thanks for wonderful information I was looking for this info for my mission.|

Highly energetic article, I

Highly energetic article, I loved that a lot. Will there be a part 2?|

I think this is among the

I think this is among the most significant info for me. And i am glad reading your article. But wanna remark on few general things, The site style is great, the articles is really nice : D. Good job, cheers|

Helpful information. Lucky me

Helpful information. Lucky me I discovered your web site unintentionally, and I'm shocked why this coincidence didn't happened earlier! I bookmarked it.|

Everything said was actually

Everything said was actually very logical. But, what about this? what if you added a little content? I am not saying your content is not solid, but what if you added a title that makes people want more? I mean %BLOG_TITLE% is kinda vanilla. You could look at Yahoo's home page and note how they create article headlines to get people to open the links. You might try adding a video or a related picture or two to get readers excited about what you've written. In my opinion, it might make your posts a little livelier.|

I know this website provides

I know this website provides quality based posts and other material, is there any other web site which provides these kinds of data in quality?|

I don't even know how I ended

I don't even know how I ended up here, but I thought this post was good. I do not know who you are but certainly you are going to a famous blogger if you are not already ;) Cheers!|

I every time emailed this web

I every time emailed this web site post page to all my friends, as if like to read it then my friends will too.|

Low Force Puncher

Every weekend i used to visit

Every weekend i used to visit this site, for the reason that i wish for enjoyment, for the reason that this this site conations actually pleasant funny material too.|

Hi there just wanted to give

Hi there just wanted to give you a quick heads up and let you know a few of the images aren't loading properly. I'm not sure why but I think its a linking issue. I've tried it in two different internet browsers and both show the same outcome.|

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.