Closed Bug 1296759 Opened 10 years ago Closed 10 years ago

Custom date field- Timezone conversion

Categories

(Bugzilla :: Bugzilla-General, defect, P3)

5.1.1
x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 946090

People

(Reporter: tonyleo81, Unassigned)

Details

I got a requirement to add custom field with date format. I have added them to bugzilla. We have users who work in Eastern timezone and in offshore timezone. At peference level we set EST for US users and IST (India) for offnore users. But the conversion is not happening for custom time field. Its happening for all standard fields thou.
Hi TonyT, unfortunately this report is not very useful because it does not describe the problem well. If you have time and can still reproduce the problem, please read https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines and add a more useful description to this report, by providing exact and specific steps to reproduce as a list of ordered steps, with exact names of URLs, fields, etc., so anyone could blindly follow your steps to reproduce your setup, leaving no room for any interpretation. Thanks! (Also, why was this both posted in Bugzilla and on the Support mailing list?)
Flags: needinfo?(tonyleo81)
I requested the user file this so I would remember to look into it.
Flags: needinfo?(tonyleo81)
Dylan, Please let me know if I need to provide steps to reproduce or I am good for now .
Is this a simple fix or something which is hard and may take longer time ? We are doing a PoC and if we cant fix this we may have to look for another tool. Thanks Tony
Note that this conversion would only make sense for date/time fields, not simply date fields. it's a pretty simple change: https://github.com/bugzilla/bugzilla/blob/master/Bugzilla/Bug.pm#L2620 should have a condition if ($field->type == FIELD_TYPE_DATETIME) { $value = datetime_from($value, Bugzilla->local_timezone); change https://github.com/bugzilla/bugzilla/blob/master/Bugzilla/Bug.pm#L4687 to return $class->_cf_accessor($field->name, $field->$type) and then in https://github.com/bugzilla/bugzilla/blob/master/Bugzilla/Bug.pm#L4693, change that to sub _cf_accessor { my ($class, $field, $type) = @_; my $accessor = sub { my ($self) = @_; if ($type == FIELD_TYPE_DATETIME) { return datetime_from($self->{$field}); } else { return $self->{$field}; } }; return $accessor; } I can write the patch if someone else wants to test it.
Flags: needinfo?(tonyleo81)
Please read bug 946090 before doing anything with this bug. And if the decision is to implement this "feature" anyway, then bug 946090 should be reopened instead as more people is watching it.
Severity: major → normal
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(tonyleo81)
You need to log in before you can comment on or make changes to this bug.