forked from ScoDoc/ScoDoc
Merge pull request 'fix_timezone_bug' (#166) from jmplace/ScoDoc-Lille:fix_timezone_bug into master
Reviewed-on: https://scodoc.org/git/viennet/ScoDoc/pulls/166
This commit is contained in:
commit
c658c7675e
@ -285,9 +285,11 @@ class ScoExcelSheet:
|
||||
|
||||
def make_cell(self, value: any = None, style=None, comment=None):
|
||||
"""Construit une cellule.
|
||||
value -- contenu de la cellule (texte ou numérique)
|
||||
value -- contenu de la cellule (texte, numérique, booléen ou date)
|
||||
style -- style par défaut (dictionnaire cf. excel_make_style) de la feuille si non spécifié
|
||||
"""
|
||||
if isinstance(value, datetime.datetime):
|
||||
value = value.replace(tzinfo=None) # make date naive (cf https://openpyxl.readthedocs.io/en/latest/datetime.html#timezones)
|
||||
cell = WriteOnlyCell(self.ws, value or "")
|
||||
if style is None:
|
||||
style = self.default_style
|
||||
|
Loading…
Reference in New Issue
Block a user