Skip to content

Commit 580f422

Browse files
committed
typescript update
1 parent 80ff4a6 commit 580f422

File tree

142 files changed

+12632
-1718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+12632
-1718
lines changed

.gitignore

Lines changed: 22 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,24 @@
1-
# C++ objects and libs
2-
*.slo
3-
*.lo
4-
*.o
5-
*.a
6-
*.la
7-
*.lai
8-
*.so
9-
*.dll
10-
*.dylib
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
119

12-
# Qt-es
13-
object_script.*.Release
14-
object_script.*.Debug
15-
*_plugin_import.cpp
16-
/.qmake.cache
17-
/.qmake.stash
18-
*.pro.user
19-
*.pro.user.*
20-
*.qbs.user
21-
*.qbs.user.*
22-
*.moc
23-
moc_*.cpp
24-
moc_*.h
25-
qrc_*.cpp
26-
ui_*.h
27-
*.qmlc
28-
*.jsc
29-
Makefile*
30-
*build*
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
3114

32-
# Qt unit tests
33-
target_wrapper.*
34-
35-
# QtCreator
36-
*.autosave
37-
38-
# QtCreator Qml
39-
*.qmlproject.user
40-
*.qmlproject.user.*
41-
42-
# QtCreator CMake
43-
CMakeLists.txt.user*
44-
45-
# QtCreator 4.8< compilation database
46-
compile_commands.json
47-
48-
# QtCreator local machine specific files for imported projects
49-
*creator.user*
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

README.md

Lines changed: 109 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,128 @@
1-
# Nepdate calendar
2-
`nepdate-calendar` provides a standalone Nepali calendar and converter for Bikram Sambat and Gregorian calendars.
1+
# Bikram Sambat Calendar
32

4-
# Nepdate widget
3+
A modern React + TypeScript web application for converting and viewing Nepali (Bikram Sambat) and Gregorian dates, with tithi calculation, event/holiday display, and a beautiful calendar UI.
54

6-
`nepdate-widget` is a desktop floating widget for Linux that displays the Nepali date. It provides the following features:
5+
## Features
76

8-
- Displays the Nepali date on your desktop.
9-
- Can be moved anywhere on the screen.
10-
- with automatic text color adjustment based on the background color.
7+
- Convert between Bikram Sambat (BS) and Gregorian (AD) dates
8+
- View Nepali and English months, days, and years
9+
- Calculate lunar tithi for any date
10+
- See major Nepali festivals and holidays
11+
- Responsive, accessible, and print-friendly calendar UI
12+
- Toggle between Nepali and English language
13+
- "Show in Calendar" and event modal support
14+
- Built with [Vite](https://vitejs.dev/), [React](https://react.dev/), [Tailwind CSS](https://tailwindcss.com/), and [shadcn/ui](https://ui.shadcn.com/)
1115

12-
##To-Do List
16+
## Getting Started
1317

14-
1. Create an installable DEB file for Debian-based distributions. (released appimages for wider linux distributions but gcc version is high now in release build. I will build with lower gcc version in future release.)
15-
2. Make the calendar responsive to window resizing.(Done)
16-
3. Implement tithi and other panchanga calculations in the calendar app.( Tithi implemented. in future i will check other components like nakshatra karan and yoga too.)
17-
4. make cross plateform application. now nepdate-calendar and widget builds and runs perfectly in windows.
18-
using qtcreator and mingw compiler. not tested cmake.(Done)
18+
### Prerequisites
1919

20-
## Dependencies
20+
- [Node.js](https://nodejs.org/) (v18+ recommended)
21+
- [Yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/)
2122

22-
Nepdate and calendar relies on the following Qt libraries:
23+
### Installation
2324

24-
- Qt Core
25-
- Qt Widgets
26-
- Qt GUI
25+
```sh
26+
git clone https://github.com/yourusername/nepdate.git
27+
cd nepdate
28+
yarn install
29+
# or
30+
npm install
31+
```
2732

28-
## Usage
33+
### Development
2934

30-
1. Clone this repository to your local machine.
31-
2. Create a build folder in the project directory.
32-
3. Build the project using `cmake ..` and then run `make all`.
33-
4. You can also compile the project using Qt Creator or Qmake.
34-
5. Run the Nepdate executables:
35-
`nepdate-widget` for the desktop widget
36-
`nepdate-calendar` for the calendar
37-
6. The floating Nepali date widget will appear on your desktop, with automatic text color adjustment based on the background color.
35+
Start the local development server:
3836

39-
## Screenshots
40-
nepdate in action ![nepdate](https://github.com/khumnath/nepdate/assets/50103558/8f17f73b-3dfd-4679-a2f9-2461d9b34cf9)
37+
```sh
38+
yarn dev
39+
# or
40+
npm run dev
41+
```
4142

43+
Open [http://localhost:8080](http://localhost:8080) in your browser.
4244

43-
## License
45+
> **Note:** If you encounter a "too many open files" error, you may need to increase your system's file watch limit. See [this StackOverflow answer](https://stackoverflow.com/questions/53930305/nodemon-error-system-limit-for-number-of-file-watchers-reached) for help.
46+
47+
### Local Production Build
48+
49+
Build and preview locally:
50+
51+
```sh
52+
yarn build
53+
yarn preview
54+
# or
55+
npm run build
56+
npm run preview
57+
```
58+
59+
This will output the production build to the `dist/` directory, which is **not pushed to GitHub**.
60+
61+
### Build for GitHub Pages
62+
63+
To build for GitHub Pages (output to `docs/` and set correct base path):
64+
65+
```sh
66+
yarn build-gh
67+
# or
68+
npm run build-gh
69+
```
70+
71+
Preview the GitHub Pages build locally:
4472

45-
This project is licensed under the **GNU General Public License (GPL) version 3**. See the LICENSE file for details.
73+
```sh
74+
yarn preview-gh
75+
# or
76+
npm run preview-gh
77+
```
4678

47-
## contribution
79+
This will output the production build to the `docs/` directory, which **should be committed and pushed** to your repository for GitHub Pages deployment.
4880

49-
first of all any suggestion and bug reports can be filed on github issue here https://github.com/khumnath/nepdate/issues
81+
### Deploy to GitHub Pages
82+
83+
1. Commit and push the `docs` folder to your repository.
84+
2. In your repository settings, set GitHub Pages to serve from the `docs` folder on the `main` branch.
85+
3. Your site will be available at `https://<username>.github.io/nepdate/`.
86+
87+
## Project Structure
88+
89+
```
90+
├── bikram-calendar/ # Bikram Sambat calendar calculation library
91+
├── src/ # React app source code
92+
│ ├── components/ # React components
93+
│ ├── data/ # Event and holiday data
94+
│ ├── hooks/ # Custom React hooks
95+
│ ├── utils/ # Utility functions
96+
│ └── index.css # Main CSS (Tailwind)
97+
├── docs/ # Production build output for GitHub Pages (should be pushed)
98+
├── dist/ # Production build output for local preview (not pushed)
99+
├── index.html # Main HTML entry
100+
├── package.json
101+
├── postcss.config.js
102+
├── tailwind.config.ts
103+
└── vite.config.ts
104+
```
105+
106+
## Scripts
107+
108+
| Command | Description |
109+
|-----------------|---------------------------------------------|
110+
| `dev` | Start local dev server |
111+
| `build` | Build for local production (`dist/`) |
112+
| `preview` | Preview local production build |
113+
| `build-gh` | Build for GitHub Pages (`docs/`) |
114+
| `preview-gh` | Preview GitHub Pages build |
115+
| `lint` | Run ESLint |
116+
117+
## Notes on Build Outputs
118+
119+
- The `dist/` directory is for local production builds and **should not be pushed to Git**.
120+
- The `docs/` directory is for GitHub Pages deployment and **should be committed and pushed**.
121+
122+
## License
50123

51-
# for contribution
52-
1. Clone repository
53-
2. make changes
54-
3. make a pull request with proper description of changes.
124+
This project is licensed under the [GPL v3 or later](https://www.gnu.org/licenses/gpl-3.0.en.html).
55125

126+
---
56127

128+
**Made with love by Khumnath.**

bikram-calendar/.npmignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
# source
3+
src
4+
5+
# builds
6+
*.tgz
7+
8+
# tests
9+
__tests__
10+
coverage
11+
jest.config.js
12+
13+
# Development files
14+
.eslintrc.js
15+
.prettierrc
16+
tsconfig.json

bikram-calendar/LICENSE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
GNU GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2024
5+
6+
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
7+
8+
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9+
10+
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

bikram-calendar/README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# bikram-calendar
2+
3+
A comprehensive JavaScript/TypeScript library for working with the Bikram Sambat (BS) calendar system used in Nepal.
4+
Provides utilities for date conversion between Bikram Sambat and Gregorian calendars, tithi (lunar day) calculation, Nepali/English digit conversion, and more.
5+
6+
---
7+
8+
## Features
9+
10+
- Convert between Bikram Sambat (BS) and Gregorian (AD) dates
11+
- Get information about Bikram months (days, start day of week)
12+
- Calculate Tithi (Lunar day)
13+
- Convert between Nepali and English digits
14+
- Access month and day names in both Nepali and English
15+
16+
---
17+
18+
## Usage
19+
20+
> **Note:**
21+
> This package is **not published to npm**.
22+
> If you want to use it, **download or clone this repository** and copy or import the `bikram-calendar` folder into your own project.
23+
> You can then import from it using a relative path, for example:
24+
25+
```typescript
26+
import {
27+
getToday,
28+
convertToBikram,
29+
convertToEnglish,
30+
calculateTithi,
31+
getNepaliDigits,
32+
getEnglishDigits,
33+
nepaliMonthsNp,
34+
nepaliMonthsEn
35+
} from './bikram-calendar'; // Adjust the path as needed
36+
```
37+
38+
---
39+
40+
## API Documentation
41+
42+
### Date Conversion
43+
44+
#### `getToday(): BikramDateObj`
45+
Returns today's date in Bikram Sambat.
46+
47+
#### `convertToBikram(date: Date): BikramDateObj`
48+
Converts a JavaScript Date to Bikram Sambat.
49+
50+
#### `convertToEnglish(bsDate: BikramDateObj): Date`
51+
Converts a Bikram Sambat date to JavaScript Date.
52+
53+
### Tithi Calculation
54+
55+
#### `calculateTithi(date: Date): TithiResult`
56+
Calculates the tithi (lunar day) for a given date.
57+
58+
### Month Information
59+
60+
#### `getBikramMonth(year: number, month: number): BikramMonth`
61+
Gets information about a Bikram month including days and start day of week.
62+
63+
### Utilities
64+
65+
#### `getNepaliDigits(num: number): string`
66+
Converts English digits to Nepali digits.
67+
68+
#### `getEnglishDigits(nepaliStr: string): string`
69+
Converts Nepali digits to English digits.
70+
71+
#### `nepaliMonthsNp`, `nepaliMonthsEn`
72+
Arrays of Nepali and English month names.
73+
74+
#### `nepaliDaysNp`, `nepaliDaysEn`
75+
Arrays of Nepali and English day names.
76+
77+
---
78+
79+
## License
80+
GNU General Public License v3.0 or later
81+
82+
This software is licensed under the GNU General Public License, which allows for free use, modification, and distribution. The GPL ensures that the software and any derivative works remain open and free. For full details, please visit [GNU GPL v3.0](https://www.gnu.org/licenses/gpl-3.0.en.html).
83+
84+
85+
---
86+
87+
**Made with love by Khumnath.**

0 commit comments

Comments
 (0)