Skip to content

Commit

Permalink
Merge pull request #46 from amitgaru2/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
amitgaru2 committed Sep 4, 2023
2 parents 10aa929 + de95df0 commit 4be49f1
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 5 deletions.
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/doctrees/index.doctree
Binary file not shown.
9 changes: 8 additions & 1 deletion docs/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,16 @@ Directives Meaning Example Notes
or -HHMM (empty string if the +1030
object is naive).

``%Z`` Time zone name (empty string (empty), UTC, EST, CST
``%Z`` Time zone name (empty string (empty), UTC, EST, CST
if the object is naive).

``%U`` Week number of the year (Sunday 00, 01, ..., 53 \(7)
as the first day of the week)
as a zero padded decimal number.
All days in a new year preceding
the first Sunday are considered
to be in week 0.

=========== ================================ ======================== =======


Expand Down
10 changes: 10 additions & 0 deletions docs/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,16 @@ <h2><a class="reference internal" href="#nepali_datetime.datetime" title="nepali
<td><p>(empty), UTC, EST, CST</p></td>
<td></td>
</tr>
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">%U</span></code></p></td>
<td><p>Week number of the year (Sunday
as the first day of the week)
as a zero padded decimal number.
All days in a new year preceding
the first Sunday are considered
to be in week 0.</p></td>
<td><p>00, 01, …, 53</p></td>
<td><p>(7)</p></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/html/searchindex.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,16 @@ Directives Meaning Example Notes
or -HHMM (empty string if the +1030
object is naive).

``%Z`` Time zone name (empty string (empty), UTC, EST, CST
``%Z`` Time zone name (empty string (empty), UTC, EST, CST
if the object is naive).

``%U`` Week number of the year (Sunday 00, 01, ..., 53 \(7)
as the first day of the week)
as a zero padded decimal number.
All days in a new year preceding
the first Sunday are considered
to be in week 0.

=========== ================================ ======================== =======


Expand Down
3 changes: 2 additions & 1 deletion nepali_datetime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Supports >= Python3.5
"""
__version__ = "1.0.8"
__version__ = "1.0.8.1"

__author__ = "Amit Garu <amitgaru2@gmail.com>"

Expand Down Expand Up @@ -58,6 +58,7 @@
'l': lambda o: ''.join(_DIGIT_NP[int(i)] for i in '%02d' % getattr(o, 'minute', 0)),
'S': lambda o: '%02d' % getattr(o, 'second', 0),
's': lambda o: ''.join(_DIGIT_NP[int(i)] for i in '%02d' % getattr(o, 'second', 0)),
'U': lambda o: '%02d' % ((o.timetuple().tm_yday + 7 - o.weekday()) // 7,),
}

_CALENDAR = {}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_strftime_strptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_strftime_date(self):

def test_strftime_datetime(self):
dt = nepali_datetime.datetime(2052, 10, 29, 15, 22, 50, 2222)
assert dt.strftime("%m/%d/%Y %I:%M:%S.%f %p %a %A") == "10/29/2052 03:22:50.002222 PM Mon Monday"
assert dt.strftime("%m/%d/%Y %I:%M:%S.%f %p %a %A %U") == "10/29/2052 03:22:50.002222 PM Mon Monday 44"


class TestStrptime:
Expand Down

0 comments on commit 4be49f1

Please sign in to comment.