Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use localized date for chart js #384

Merged
merged 4 commits into from
Nov 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Changelog

**Fixed**

- #384 Integration of PR-2306. Do not use localized date for chart js
- #382 Integration of PR-2305. Bika Listing for Analysis Specifications fails on category expansion
- #380 Integration of PR-2302. UnicodeDecodeError if title field validator
- #344 Integration of PR-2273. Ensure no counters in the number generator before initialising id server
Expand Down
26 changes: 13 additions & 13 deletions bika/lims/browser/referencesample.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.

from AccessControl import getSecurityManager
from bika.lims.browser import BrowserView
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.browser.bika_listing import BikaListingView
from bika.lims.utils import isActive
from bika.lims.browser.analyses import AnalysesView
import json
from datetime import datetime
from operator import itemgetter
from plone.app.layout.globals.interfaces import IViewView
from Products.Archetypes.config import REFERENCE_CATALOG

from Products.ATContentTypes.utils import DT2dt
from Products.Archetypes.config import REFERENCE_CATALOG
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.component import getMultiAdapter
from bika.lims import bikaMessageFactory as _, logger
from bika.lims.browser import BrowserView
from bika.lims.browser.analyses import AnalysesView
from bika.lims.browser.bika_listing import BikaListingView
from bika.lims.utils import t
from plone.app.layout.globals.interfaces import IViewView
from zope.interface import implements
import json, plone


class ViewView(BrowserView):
""" Reference Sample View
Expand Down Expand Up @@ -190,6 +189,8 @@ def addToJSON(self, analysis, service_uid, item):
anrows = trows.get(qcid, [])
anid = '%s.%s' % (item['getReferenceAnalysesGroupID'], item['id'])
rr = parent.getResultsRangeDict()
cap_date = item.get('CaptureDate', None)
cap_date = cap_date and cap_date.strftime('%Y-%m-%d %I:%M %p') or ''
if service_uid in rr:
specs = rr.get(service_uid, None)
try:
Expand All @@ -201,8 +202,7 @@ def addToJSON(self, analysis, service_uid, item):
error_amount = ((target / 100) * error) if target > 0 else 0
upper = smax + error_amount
lower = smin - error_amount

anrow = {'date': item['CaptureDate'],
anrow = {'date': cap_date,
'min': smin,
'max': smax,
'target': target,
Expand Down