Giter Site home page Giter Site logo

saeedrahimi / antd-jalali Goto Github PK

View Code? Open in Web Editor NEW
77.0 77.0 35.0 3.03 MB

A wrapper for ant-design date picker and calendar to support Jalali calendar type

Home Page: https://saeedrahimi.github.io/antd-jalali/

TypeScript 63.06% HTML 7.46% JavaScript 29.49%

antd-jalali's Introduction

Hi there, I'm Saeed 👋.

I'm a software developer based in Düsseldorf, Germany.

You can reach me at

antd-jalali's People

Contributors

mohas avatar saeedrahimi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

antd-jalali's Issues

Error hot fix

SyntaxError: Unexpected token 'export'

nextjs : 10.0.2
react: 17.0.1

Screen Shot 1399-09-03 at 17 24 23

defaultPickerValue not working

Hi, thanks for developing this component.
I think there is a bug in setting defaultPickerValue. and component does not work properly
please check.
thanks
213132
Screenshot from 2021-05-06 19-05-13

Wrong Week Days

at saeedrahimi.github.io demo
in Jalali Datepicker

dates are assigned to wrong week days.
e.g. "12 Mehr 1402" is displayed as "ی" (Yekshanbeh) whereas it should be "چ" (Chaharshanbeh).

we have the same issue on our own project.

overwritten css styles in Nextjs

when i import "antd/dist/antd.css" , the font and some of globals.css and tailwind style are overwritten .

Can you guide me how to import "antd/dist/antd.css" without globals.css styles overwritten in Nextjs 12 ?

year in date-picker is suddenly Gregorian after updating dayjs and antd

Hi, thank you for awesome work on the library, I notice that after updating dayjs and antd in my project to versions 1.11.0 and 4.19.3 respectively, year in date-picker turned into Gregorian year (2022), can you have a look.

I tried to fork and build the lib myself but it seems that the latest version on react-script is incompatible with your project structure, it needs the library to be in the src folder while it is in the lib folder, also I noticed a getFirstWeekDate is added to dayjs interface which is not implemented.

would you be interested in a separate demo folder for vercel app? or a storybook?

Error styles

Unexpected character '@'

nextjs: 10.0.2
react: 17.0.1
./node_modules/antd/lib/calendar/style/index.less 1:0
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> @import '../../style/themes/index';
| @import '../../style/mixins/index';

Screen Shot 1399-09-03 at 17 27 29

error set default value

I give an error when I try to give the default date, thank you for your help
I also used these commands to set:

const date = dayjs("1399-01-01", {jalali:true});

Or
const date = dayjs(date).calendar('jalali').locale('fa')

errors:
image

problem with using in nextjs

./node_modules/antd/lib/button/style/index.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

@import '../../style/themes/index';
| @import '../../style/mixins/index';
| @import './mixin';

hi i use antd-jalali in nextjs and have this problem how can i fix that

how to set value

Hi, thanks for this module.
I wanted to give the calendar a value that has it as a value, I could not find anything in the documents

Beginning of the first day of the month, with the wrong day

Hi

When the last day of the month is Friday, it shows the first day of the next month with the wrong day
for example :
The last day of Day 1400 is Friday
But the first day of the next month, which is Bahman, is displayed from Monday instead of Saturday
Screenshot (1)

Error in build

nextjs v9.4.4
react 16.13.1

/node_modules/antd-jalali/dist/index.js:1
export { default as DatePicker } from "./DatePicker";
^^^^^^

SyntaxError: Unexpected token 'export'
    at wrapSafe (internal/modules/cjs/loader.js:1054:16)
    at Module._compile (internal/modules/cjs/loader.js:1102:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)

bug in mounth length

when I set value or defaultValue with this format :
const date = dayjs("1399-01-01", {jalali:true});
<RangePicker defaultValue=[date, date] />
the Jalali month length is being wrong. for example :
اردیبهشت 1400: is 28 days!
خرداد 1400: is 31 days
تیر 1400: is 30 days!
image

antd-jalali datepicker problem when setting initial value via form instance

when i'm trying to set initial value for jalali datepicker via form.setFieldsValue the datepicker popup container goes crazy and i can't figure the problem and you can not select a date until you choose the today date and then it is possible to choose date
Screenshot (22)

this is the part of my code that i'm trying to set datePicker initial value

form.setFieldsValue({
        
        date: moment(DATE, 'YYYY-MM-DD'),
      })
 <Form.Item name="date" label="تاریخ قرارداد" labelCol={{ span: 24 }}>
                <JalaliDatePicker
                  format="YYYY-MM-DD"
                  style={{ width: '100%' }}
                />
              </Form.Item>

Error calling localized month name formatting after instantiating any controls.

After using any control in my react tree calling dayjs().locale('fa').format('MMM') or any other month name formatter will fail.
This s because jalaliday adds a jmonth array to dayjs locale object, while you use your own custom locale object, so calling format, jalaliday expects a jmonth array to be available which is not, thus the error.

I will submit a pull request for a quick fix, but in general I think that you should avoid defining your custom locale object and just use the default dayjs one

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.