~tfr/openobject-client/tfr-packaging

« back to all changes in this revision

Viewing changes to bin/widget/view/graph_gtk/graph.py

[MERGE] user locale to server side defined locale

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
import locale
31
31
import rpc
32
32
import tools
33
 
from tools import datetime_util
 
33
from tools import user_locale_format, datetime_util
34
34
 
35
35
from widget.view import interface
36
36
from widget.view.list import group_record
39
39
DT_FORMAT = '%Y-%m-%d'
40
40
DHM_FORMAT = '%Y-%m-%d %H:%M:%S'
41
41
HM_FORMAT = '%H:%M:%S'
42
 
LDFMT = tools.datetime_util.get_date_format()
43
42
 
44
43
import tinygraph
45
44
import matplotlib
121
120
                elif self.fields[x]['type'] == 'date':
122
121
                    if field_val:
123
122
                        res[x] = datetime_util.server_to_local_timestamp(field_val,
124
 
                                    DT_FORMAT, LDFMT, tz_offset=False)
 
123
                                    DT_FORMAT, user_locale_format.get_date_format(), tz_offset=False)
125
124
                    else:
126
125
                        res[x] = 'Undefined'
127
126
                elif self.fields[x]['type'] == 'datetime':
128
127
                    if field_val:
129
128
                        res[x] = datetime_util.server_to_local_timestamp(field_val,
130
 
                                    DHM_FORMAT, LDFMT+' %H:%M:%S')
 
129
                                    DHM_FORMAT, user_locale_format.get_datetime_format(True))
131
130
                    else:
132
131
                        res[x] = 'Undefined'
133
132
                else:
141
140
            self._canvas.queue_resize()
142
141
        except:
143
142
            pass
144
 
        
 
143
 
145
144
    def destroy(self):
146
145
        pass
147
146