q2rad 0.1.227__tar.gz → 0.1.228__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of q2rad might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: q2rad
3
- Version: 0.1.227
3
+ Version: 0.1.228
4
4
  Summary: RAD - database, GUI, reports
5
5
  Author: Andrei Puchko
6
6
  Author-email: andrei.puchko@gmx.de
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "q2rad"
3
- version = "0.1.227"
3
+ version = "0.1.228"
4
4
  description = "RAD - database, GUI, reports"
5
5
  authors = ["Andrei Puchko <andrei.puchko@gmx.de>"]
6
6
  readme = "README.md"
@@ -179,23 +179,35 @@ def ensure_empty_pk(table="", row={}, q2_db=None):
179
179
 
180
180
 
181
181
  def dtoc(date, format_from="%Y-%m-%d", format_to="%d.%m.%Y"):
182
- return datetime.datetime.strptime(date, format_from).strftime(format_to)
182
+ try:
183
+ return datetime.datetime.strptime(date, format_from).strftime(format_to)
184
+ except Exception:
185
+ return ""
183
186
 
184
187
 
185
188
  def ctod(date, format_from="%d.%m.%Y", format_to="%Y-%m-%d"):
186
- return dtoc(date, format_from, format_to)
189
+ try:
190
+ return dtoc(date, format_from, format_to)
191
+ except Exception:
192
+ return ""
187
193
 
188
194
 
189
195
  def first_day_of_month(date):
190
- _date = datetime.datetime.strptime(date, "%Y-%m-%d")
191
- _date = _date.replace(day=1)
192
- return _date.strftime("%Y-%m-%d")
196
+ try:
197
+ _date = datetime.datetime.strptime(date, "%Y-%m-%d")
198
+ _date = _date.replace(day=1)
199
+ return _date.strftime("%Y-%m-%d")
200
+ except Exception:
201
+ return date
193
202
 
194
203
 
195
204
  def last_day_of_month(date):
196
- _date = datetime.datetime.strptime(date, "%Y-%m-%d")
197
- _date = _date.replace(day=calendar.monthrange(_date.year, _date.month)[1])
198
- return _date.strftime("%Y-%m-%d")
205
+ try:
206
+ _date = datetime.datetime.strptime(date, "%Y-%m-%d")
207
+ _date = _date.replace(day=calendar.monthrange(_date.year, _date.month)[1])
208
+ return _date.strftime("%Y-%m-%d")
209
+ except Exception:
210
+ return date
199
211
 
200
212
 
201
213
  def ffinder(module_name="module", function_name="fname"):
@@ -0,0 +1 @@
1
+ __version__ = "0.1.228"
@@ -1 +0,0 @@
1
- __version__ = "0.1.227"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes