Re: Re: Designer Content 日付入力の仕方

2012年7月22日 at 15:14

ありがとうございます。
調べてみます。

Re: Designer Content 日付入力の仕方

2012年7月22日 at 20:51
まず、designer content で 日付ピッカーのフィールドをPHP Date フォーマットを "n月j日" で作成し、
その他必要なフィールドを作成して、ブロックを作成します。
例としてブロックハンドルをtestblockとします。
作ったブロックが/blocks/testblockフォルダに作成されていますので
その中のview.phpの日付ピッカーで作成した部分を変更します。
$field_xx_date_value の xxの部分には数字が入ります。
この部分はブロックの作成時によって異なるので気をつけてください。

<?php if (!empty($field_xx_date_value)): ?>
<?php echo date('n月j日', strtotime($field_xx_date_value)); ?>
<?php endif; ?>



<?php if (!empty($field_xx_date_value)): ?>
<?php $wd = array( "日", "月", "火", "水", "木", "金", "土" ); ?>
<?php $week = date('w', strtotime($field_xx_date_value)); ?>
<?php echo date('n月j日(' . $wd[$week] . ')', strtotime($field_xx_date_value)); ?>
<?php endif; ?>

うまく説明できないので、不明点あればまたフォーラムに書き込んでください。
 

Re: Designer Content 日付入力の仕方

2012年7月23日 at 9:36
大変詳しく説明していただいて、ありがとうございます。
色々試してみます。