MCPcopy
hub / github.com/neuml/paperai / date

Method date

src/python/paperai/query.py:167–187  ·  view source on GitHub ↗

Formats a date string. Args: date: input date string Returns: formatted date

(date)

Source from the content-addressed store, hash-verified

165
166 @staticmethod
167 def date(date):
168 """
169 Formats a date string.
170
171 Args:
172 date: input date string
173
174 Returns:
175 formatted date
176 """
177
178 if date:
179 date = datetime.datetime.strptime(date, "%Y-%m-%d %H:%M:%S")
180
181 # 1/1 dates had no month/day specified, use only year
182 if date.month == 1 and date.day == 1:
183 return date.strftime("%Y")
184
185 return date.strftime("%Y-%m-%d")
186
187 return None
188
189 @staticmethod
190 def text(text):

Callers 7

testEmptyMethod · 0.80
searchMethod · 0.80
queryMethod · 0.80
buildRowMethod · 0.80
buildRowMethod · 0.80
buildRowMethod · 0.80
searchMethod · 0.80

Calls

no outgoing calls

Tested by 1

testEmptyMethod · 0.64