Anonymous | Login | Signup for a new account | 2023-12-05 02:30 CST | ![]() |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Viewing Issue Advanced Details [ Jump to Notes ] [ Wiki ] | [ View Simple ] [ Issue History ] [ Print ] | ||||||
ID | Category | Type | Reproducibility | Date Submitted | Last Update | ||
0000453 | [In-Portal CMS] Data Management | feature request | always | 2009-12-16 13:53 | 2010-07-22 15:06 | ||
Reporter | Dmitry | View Status | public | Project Name | In-Portal CMS | ||
Assigned To | alex | Developer | |||||
Priority | normal | Resolution | fixed | Platform | |||
Status | closed | OS | |||||
OS Version | |||||||
ETA | none | Fixed in Version | 5.1.0-B1 | Product Version | 5.0.1 | ||
Target Version | 5.1.0 | Product Build | |||||
Time Estimate | No estimate | ||||||
Summary | 0000453: Create new Tag to display language-specific Date parts | ||||||
Description |
I propose to create tag for displaying language-specific date parts, like weekday, month name etc. on site language, not always on english as date function of php offers. |
||||||
Steps To Reproduce |
Code is supposed to be new tag in kDBTagProcessor like Field tag is. Only difference is that it will display formatted date field contents. Optional parameter "value" will allow to format any abstract date as well (not from database). Code, I've attached is helper method, that was called from LanguageDate tag. Tag CurrentDate in LanguageTagProcessor is not related to this discussion in any way. |
||||||
Additional Information |
Proposed solution, that needs to be adapted into new tag in kDBTagProcessor: /** * Returns formatted date + time on current language * * @param string $format * @param int $timestamp * @param string $case_suffixes * @return string */ function LanguageDate($format, $timestamp = false, $case_suffixes = '') { if (!$timestamp) $timestamp = adodb_mktime(); // apply timezone adjustment manually (because we are not using kDateFormatter) $date = $timestamp + $this->Application->TimeZoneAdjustment(); $replacements = Array ( 'l' => 'la_WeekDay', 'D' => 'la_WeekDay', 'M' => 'la_Month', 'F' => 'la_Month', ); if ($case_suffixes) { // apply case suffixes (for russian language only) $case_suffixes = explode(',', $case_suffixes); foreach ($case_suffixes as $case_suffux) { list ($replacement_name, $case_suffix_value) = explode('=', $case_suffux, 2); $replacements[$replacement_name] .= $case_suffix_value; } } foreach ($replacements as $format_char => $phrase_prefix) { if (strpos($format, $format_char) === false) { unset($replacements[$format_char]); continue; } $replacements[$format_char] = $this->Application->Phrase($phrase_prefix . adodb_date($format_char, $date)); $format = str_replace($format_char, '#' . ord($format_char) . '#', $format); } $date_formatted = adodb_date($format, $date); foreach ($replacements as $format_char => $format_replacement) { $date_formatted = str_replace('#' . ord($format_char) . '#', $format_replacement, $date_formatted); } return $date_formatted; } |
||||||
Tags | No tags attached. | ||||||
Reference | Google Groups http://groups.google.com/group/in-portal-dev/browse_thread/thread/3bae12a838020827 | ||||||
Change Log Message | |||||||
Estimate Points | 0 | ||||||
Attached Files |
![]() |
||||||
|
![]() |
|
![]() |
|
![]() Dmitry (manager) 2010-04-27 18:22 |
Tested okay. Had to manually merge it, but tested okay. |
![]() alex (manager) 2010-04-28 06:02 |
Fix committed to 5.1.x branch. Commit Message: Fixes 0000453: Create new Tag to display language-specific Date parts |
![]() alex (manager) 2010-07-22 15:06 |
Closing, since 5.1.0 release has been released. |
![]() |
|||
In-Portal CMS: 5.1.x r13451 Timestamp: 2010-04-28 06:02:28 Author: alex [ Details ] [ Diff ] |
Fixes 0000453: Create new Tag to display language-specific Date parts | ||
mod - /in-portal/branches/5.1.x/core/kernel/db/db_tag_processor.php | [ Diff ] [ File ] | ||
![]() |
|||
Date Modified | Username | Field | Change |
2010-07-22 15:06 | alex | Note Added: 0002545 | |
2010-07-22 15:06 | alex | Status | resolved => closed |
2010-04-28 06:02 | alex | Note Added: 0002005 | |
2010-04-28 06:02 | alex | Status | reviewed and tested => resolved |
2010-04-28 06:02 | alex | Fixed in Version | => 5.1.0-B1 |
2010-04-28 06:02 | alex | Resolution | open => fixed |
2010-04-28 06:02 | alex | Assigned To | !COMMUNITY => alex |
2010-04-28 06:02 | alex | Changeset attached | 5.1.x r13451 |
2010-04-27 18:22 | Dmitry | Time Estimate Removed | 1 => |
2010-04-27 18:22 | Dmitry | Note Added: 0001994 | |
2010-04-27 18:22 | Dmitry | Status | needs testing => reviewed and tested |
2010-02-27 04:05 | alex | Developer | => alex |
2010-01-12 11:11 | alex | Time Estimate Added | 1 |
2010-01-12 10:48 | alex | Target Version | Icebox => 5.1.0 |
2009-12-19 04:31 | alex | Assigned To | => !COMMUNITY |
2009-12-19 04:31 | alex | Status | active => needs testing |
2009-12-19 04:31 | alex | File Added: date_field_tag.patch | |
2009-12-16 13:53 | Dmitry | New Issue | |
2009-12-16 13:53 | Dmitry | Reference | => Google Groups http://groups.google.com/group/in-portal-dev/browse_thread/thread/3bae12a838020827 |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic![]() In-Portal Open Source CMS |