Skip to content

Commit d25a72d

Browse files
authored
new version with updated command options (#1)
2 parents dedff66 + 7023d28 commit d25a72d

File tree

3 files changed

+310
-128
lines changed

3 files changed

+310
-128
lines changed

README.md

Lines changed: 75 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ nepdate-cli is a command-line tool for displaying and converting dates between t
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

@@ -23,104 +24,118 @@ There are two installation methods available: using a Debian package or compilin
2324
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/opensource-nepal/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
54+
```bash
55+
mkdir build
56+
cd build
57+
cmake ..
58+
make
59+
sudo make install
60+
```
6161

62-
```
63-
mkdir build
64-
cd build
65-
cmake ..
66-
make
67-
sudo make install
68-
69-
```
70-
* 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.)
71-
* ``` dpkg-buildpackage -b -us -uc``` command builds debian package without signing.
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
80-
81-
```
69+
```bash
8270
nepdate-cli
8371
```
84-
output:
85-
![Screenshot_select-area_20240810182013](https://github.com/user-attachments/assets/7b0f2e84-ec09-44a0-9edc-37bd46a682c4)
86-
* Convert to Bikram Sambat
72+
73+
Output:
8774
```
88-
nepdate-cli --conv --tobs 2024 8 10
75+
Today's Date:
76+
Gregorian: 2024 11 15 Friday
77+
Bikram Sambat: 2081 8 30 शुक्रवार days in bikram month: 30
8978
```
90-
output:
91-
![Screenshot_select-area_20240810182157](https://github.com/user-attachments/assets/474ff597-829e-4f48-8d16-079673f902fd)
92-
9379
94-
* Convert a Bikram Sambat date to Gregorian:
9580
```
96-
nepdate-cli --conv --toad 2081 4 26
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'
9788

98-
```
99-
output:
100-
![Screenshot_select-area_20240810182318](https://github.com/user-attachments/assets/308500ee-15dc-42a3-a1d5-9d5d729b267b)
89+
Format Specifiers:
90+
y : Year
91+
m : Month (numeric)
92+
d : Day
93+
w : Weekday name
94+
M : Month name
10195

102-
* Show only Bikram sambat date:
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.
103100
```
104-
nepdate-cli --today
105101
106-
```
107-
output:
108-
![Screenshot_select-area_20241109224159](https://github.com/user-attachments/assets/be8fdad0-9951-4cbd-a39e-cdfb6d37e46c)
102+
### Examples:
103+
104+
1. Show today's date in Devanagari script with default format:
105+
```bash
106+
./ndate --today --unicode
107+
```
108+
Output: २०८१-८-३०
109+
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: ३०-श्रावण-२०८१
109121
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: शुक्रवार, २०८१-८-३०
110127
111-
### ** Replace the date strings with the date you want to convert.
112128
113-
## Contributing
129+
### Contributing
114130
115131
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).
116132
117133
Here's a quick guide to contributing code:
118134
119135
1. Fork the repository.
120-
3. Create a new branch for your changes.
121-
5. Commit your changes and push them to your fork.
122-
7. Open a pull request against the main branch of the original repository.
123-
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.
124139
125140
### License
126141

debian/changelog

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
nepdate-cli (1.0.0) stable; urgency=medium
1+
nepdate-cli (1.0.2) stable; urgency=medium
22

3-
* Initial release.
3+
* update with date output format
4+
* added option to display only Bikram sambat date
5+
* rearranged for repo change
46

57
-- khumnath <[email protected]> Fri, 09 Aug 2024 12:00:00 +0000

0 commit comments

Comments
 (0)