Time ago formater works good to find user age per year. But it add unnecessary wording: "29 years 2 weeks ago"

1. How to only output "29" integer for age???
2. How come no language or text string options? Is it baked in? Am I missing a README?

I have search module for 2+ hours trying to discover removal of string...

Any help please? My English not so good. I am new to Date module. Thank you!

Comments

karens’s picture

Status: Active » Fixed

This is a way, but there was some broken code keeping it from working right.

http://drupalcode.org/project/date.git/commit/1a7dd41

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

snufkin’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new2.75 KB

It would be really useful if the module would offer an extra option for this out of the box, otherwise I would have to create a contrib module duplicating a lot of the formatter code, because there is no other way to overwrite it unfortunately.

Attaching a patch that adds an extra settings option to the formatter and depending on that boolean appends the 'ago' bit, or not.

Status: Needs review » Needs work

The last submitted patch, 1405364-format_interval_option-no-ago.patch, failed testing.

snufkin’s picture

Status: Needs work » Needs review
StatusFileSize
new3.67 KB

Fixed a silly syntax error and actually tested it.

arlinsandbulte’s picture

Status: Needs review » Needs work
+++ b/date.field.inc
@@ -70,8 +71,10 @@ function date_field_formatter_settings_summary($field, $instance, $view_mode) {
       $summary = date_interval_formatter_settings_summary($field, $instance, $view_mode);
+		break;
     default:
       $summary = date_default_formatter_settings_summary($field, $instance, $view_mode);
+		break;

Code style: incorrect indentation.

snufkin’s picture

Status: Needs work » Needs review
StatusFileSize
new3.67 KB

Nasty tabs, sneaking up on innocent developers.

karens’s picture

Status: Needs review » Fixed

I'll see you and I'll raise you one. I switched this around so it has all the same options that Views uses for the format_interval display. That way all the options (and translations) will be the same.

http://drupalcode.org/project/date.git/commit/cf89e5f

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.