Skip to content

Commit 575504b

Browse files
authored
Merge pull request khumnath#3 from opensource-nepal/dev-khumnath
upstream update
2 parents 70dea0d + 6a96532 commit 575504b

File tree

8 files changed

+366
-127
lines changed

8 files changed

+366
-127
lines changed

README.md

Lines changed: 82 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -5,119 +5,142 @@ nepdate-cli is a command-line tool for displaying and converting dates between t
55
> [!NOTE]
66
> Rust port is available at rust branch of this repository. if you want to install just binary using cargo use
77
> ``` cargo install nepdate-cli ``` or use as dependency on Cargo.toml file. ``` nepdate-cli = "0.1.3" ```
8-
> check https://github.com/khumnath/nepdate-cli/blob/rust/src/bikram.rs for available functions or https://github.com/khumnath/nepdate-cli/blob/rust/src/main.rs for example uses.
9-
> read readme file for rust https://github.com/khumnath/nepdate-cli/blob/rust/README.md
8+
> check https://github.com/opensource-nepal/nepdate-cli/blob/rust/src/bikram.rs for available functions or https://github.com/opensource-nepal/nepdate-cli/blob/rust/src/main.rs for example uses.
9+
> read readme file for rust https://github.com/opensource-nepal/nepdate-cli/blob/rust/README.md
1010
1111
### Features
1212

1313
- Display the current Bikram Sambat date.
1414
- Convert dates between Bikram Sambat and Gregorian calendars.
15-
- Supports very long date range.
15+
- Supports date formatting with devnagari script and date format specifiers.
16+
- Supports very long date range.
1617

1718
### Installation
1819

1920
There are two installation methods available: using a Debian package or compiling from source.
2021

2122
#### From Debian Package
2223

23-
1. **Download the latest `.deb` file** from the [releases](https://github.com/khumnath/nepdate-cli/releases) page.
24+
1. **Download the latest `.deb` file** from the [releases](https://github.com/opensource-nepal/nepdate-cli/releases) page.
2425
2. **Install the package** using `dpkg`:
2526

26-
Bash
27+
```bash
28+
sudo dpkg -i nepdate-cli_1.0.0_amd64.deb
29+
```
2730

28-
```
29-
sudo dpkg -i nepdate-cli_1.0.0_amd64.deb
30-
31-
```
32-
33-
Replace `nepdate-cli_1.0.0_amd64.deb` with the filename of the downloaded package.
31+
Replace `nepdate-cli_1.0.0_amd64.deb` with the filename of the downloaded package.
3432

3533

3634
#### From Source
3735

3836
1. Clone the repository:
3937

40-
Bash
41-
```
42-
git clone https://github.com/khumnath/nepdate-cli.git
43-
cd nepdate-cli
44-
```
38+
```bash
39+
git clone https://github.com/opensource-nepal/nepdate-cli.git
40+
cd nepdate-cli
41+
```
4542

4643
2. Install dependencies:
4744

48-
Bash
45+
```bash
46+
sudo apt-get update
47+
sudo apt-get install -y cmake build-essential debhelper devscripts
48+
```
4949

50-
```
51-
sudo apt-get update
52-
sudo apt-get install -y cmake build-essential debhelper devscripts
53-
54-
```
55-
56-
* packages debhelper and devscripts are for building debian installer package.
50+
*packages debhelper and devscripts are for building debian installer package.*
5751

5852
3. Build and install:
5953

60-
Bash
61-
62-
```
63-
mkdir build
64-
cd build
65-
cmake ..
66-
make
67-
sudo make install
68-
69-
```
70-
* if need to build deb package, run ``` dpkg-buildpackage -b``` after ```make```
54+
```bash
55+
mkdir build
56+
cd build
57+
cmake ..
58+
make
59+
sudo make install
60+
```
7161

62+
*if need to build deb package with signing, run `dpkg-buildpackage -b` from project root directory. (you have to edit email address to yours in files in /debian folder.)*
63+
*`dpkg-buildpackage -b -us -uc` command builds debian package without signing.*
7264

7365
### Usage
7466

7567
Once installed, you can use nepdate-cli from the command line. Here are some basic commands:
7668

77-
- Display the current Bikram Sambat date:
78-
79-
Bash
69+
```bash
70+
nepdate-cli
71+
```
8072

73+
Output:
8174
```
82-
nepdate-cli
75+
Today's Date:
76+
Gregorian: 2024 11 15 Friday
77+
Bikram Sambat: 2081 8 30 शुक्रवार days in bikram month: 30
8378
```
84-
output:
85-
![Screenshot_select-area_20240810182013](https://github.com/user-attachments/assets/7b0f2e84-ec09-44a0-9edc-37bd46a682c4)
86-
* Convert to Bikram Sambat
79+
8780
```
88-
nepdate-cli --conv --tobs 2024 8 10
81+
Usage:
82+
Show today's date: ./ndate --today [--unicode] [--format format_string]
83+
Convert to Bikram Sambat Date: ./ndate --tobs year month day [--unicode] [--format format_string]
84+
Convert to Gregorian Date: ./ndate --toad year month day [--unicode] [--format format_string]
85+
Options:
86+
--unicode : Display the date in Unicode format (Devanagari script).
87+
--format format_string : Specify a custom format for the date (e.g., 'y-m-d', 'd-M-y'). Default: 'y-m-d'
88+
89+
Format Specifiers:
90+
y : Year
91+
m : Month (numeric)
92+
d : Day
93+
w : Weekday name
94+
M : Month name
95+
96+
Example commands:
97+
./ndate --today --unicode --format 'd-M-y' : Show today's date in Unicode with custom format.
98+
./ndate --tobs 2024 11 15 --unicode --format 'y-m-d' : Convert a Gregorian date to Bikram Sambat date.
99+
./ndate --toad 2081 8 30 --unicode --format 'y/m/d' : Convert a Nepali date to Gregorian date.
89100
```
90-
output:
91-
![Screenshot_select-area_20240810182157](https://github.com/user-attachments/assets/474ff597-829e-4f48-8d16-079673f902fd)
92101
102+
### Examples:
93103
94-
* Convert a Bikram Sambat date to Gregorian:
95-
```
96-
nepdate-cli --conv --toad 2081 4 26
104+
1. Show today's date in Devanagari script with default format:
105+
```bash
106+
./ndate --today --unicode
107+
```
108+
Output: २०८१-८-३०
97109
98-
```
99-
output:
100-
![Screenshot_select-area_20240810182318](https://github.com/user-attachments/assets/308500ee-15dc-42a3-a1d5-9d5d729b267b)
110+
2. Convert a Gregorian date to Bikram Sambat date in Devanagari script:
111+
```bash
112+
./ndate --tobs 2024 11 15 --unicode
113+
```
114+
Output: २०८१-८-३०
115+
116+
3. Show today's date with custom format 'd-M-y':
117+
```bash
118+
./ndate --today --format 'd-M-y'
119+
```
120+
Output: ३०-श्रावण-२०८१
101121
122+
4. Convert a Bikram Sambat date to Gregorian date with weekday name:
123+
```bash
124+
./ndate --toad 2081 8 30 --format 'w, y-m-d' --unicode
125+
```
126+
Output: शुक्रवार, २०८१-८-३०
102127
103-
### ** Replace the date strings with the date you want to convert.
104128
105-
## Contributing
129+
### Contributing
106130
107-
Contributions are welcome! If you have any bug reports or feature requests, please open an issue on the GitHub [repository](https://github.com/khumnath/nepdate-cli).
131+
Contributions are welcome! If you have any bug reports or feature requests, please open an issue on the GitHub [repository](https://github.com/opensource-nepal/nepdate-cli).
108132
109133
Here's a quick guide to contributing code:
110134
111135
1. Fork the repository.
112-
3. Create a new branch for your changes.
113-
5. Commit your changes and push them to your fork.
114-
7. Open a pull request against the main branch of the original repository.
115-
136+
2. Create a new branch for your changes.
137+
3. Commit your changes and push them to your fork.
138+
4. Open a pull request against the main branch of the original repository.
116139
117140
### License
118141
119142
nepdate-cli is released under the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html). See the LICENSE file for more details.
120143
121144
### Contact
122145
123-
For any inquiries, you can reach out to [khumnath](https://khumnath.com.np) cg.
146+
For any inquiries, you can reach out to [khumnath cg](https://khumnath.com.np) .

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Priority: optional
44
Maintainer: khumnath <[email protected]>
55
Build-Depends: debhelper-compat (= 13), cmake
66
Standards-Version: 4.6.1
7-
Homepage: https://github.com/khumnath/nepdate-cli
7+
Homepage: https://github.com/opensource-nepal/nepdate-cli
88

99
Package: nepdate-cli
1010
Architecture: any

debian/copyright

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
22
Upstream-Name: nepdate-cli
33
Upstream-Contact: khumnath cg <[email protected]>
4-
Source: https://github.com/khumnath/nepdate-cli
4+
Source: https://github.com/opensource-nepal/nepdate-cli
55

66
Files: *
77
Copyright: 2024 khumnath cg <[email protected]>

debian/upstream/metadata

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
Bug-Database: https://github.com/khumnath/nepdate-cli/issues
3-
Bug-Submit: https://github.com/khumnath/nepdate-cli/issues/new
4-
Repository: https://github.com/khumnath/nepdate-cli/issues.git
5-
Repository-Browse: https://github.com/khumnath/nepdate-cli
2+
Bug-Database: https://github.com/opensource-nepal/nepdate-cli/issues
3+
Bug-Submit: https://github.com/opensource-nepal/nepdate-cli/issues/new
4+
Repository: https://github.com/opensource-nepal/nepdate-cli/issues.git
5+
Repository-Browse: https://github.com/opensource-nepal/nepdate-cli

debian/watch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version=4
22
opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/toml11-$1\.tar\.gz/ \
3-
https://github.com/khumnath/nepdate-cli/tags .*/v?(\d\S+)\.tar\.gz
3+
https://github.com/opensource-nepal/nepdate-cli/tags .*/v?(\d\S+)\.tar\.gz
44

src/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 3.5)
2-
project(ndate VERSION 1.0.0)
2+
project(nepdate-cli VERSION 1.0.0)
33

44
set(CMAKE_CXX_STANDARD 11)
55

6-
add_executable(ndate main.cpp)
6+
add_executable(nepdate-cli main.cpp)
77

88
set(CMAKE_INSTALL_PREFIX /usr/local)
99

1010
# Install the executable (adjust the path if necessary)
11-
install(TARGETS ndate)
11+
install(TARGETS nepdate-cli)

src/bikram.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
/*
2+
* Copyright (C) 2024 Khumnath CG
3+
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
19+
120
#ifndef BIKRAM_H
221
#define BIKRAM_H
322
#include <iostream>

0 commit comments

Comments
 (0)