{"_id":"@dasch-swiss/jdnconvertiblecalendar","_rev":"8-913b5b19548c3b7b91de9331445d216f","name":"@dasch-swiss/jdnconvertiblecalendar","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@dasch-swiss/jdnconvertiblecalendar","version":"0.0.1","author":{"name":"Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors. Email to support@dasch.swiss."},"license":"Apache-2.0","_id":"@dasch-swiss/jdnconvertiblecalendar@0.0.1","maintainers":[{"name":"julien-dasch-swiss","email":"julien.schneider@dasch.swiss"},{"name":"mpro-dasch","email":"marcin.procyk@dasch.swiss"},{"name":"subotic","email":"ibs@subotic.ch"},{"name":"daschbot","email":"daschbot@dasch.swiss"}],"homepage":"https://github.com/dasch-swiss/dsp-app#readme","dist":{"shasum":"daa09d1ceda19cfc35cab07009033b686a7360ce","tarball":"https://registry.npmjs.org/@dasch-swiss/jdnconvertiblecalendar/-/jdnconvertiblecalendar-0.0.1.tgz","fileCount":33,"integrity":"sha512-nUnmiihPoRvY3E/ZdzlrK2Sq7Rm1MZomWJ5qhZLlGxG+Nfns3MKdgQufVGWAnV1l8RImDYCLazsqG5YgjWGvmg==","signatures":[{"sig":"MEUCIDu3SnfkdI3s6h9YlGZVqc6NwMR0yLVO2T2AUvj9/CglAiEAjgwmArpGzea7SyrotIng7mvDAHdyDRaDJFfgoTCC0PM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103769},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"89af106d65d545812997de8caa5b57922b40caae","_npmUser":{"name":"julien-dasch-swiss","email":"julien.schneider@dasch.swiss"},"_npmVersion":"10.1.0","description":"## Introduction","directories":{},"_nodeVersion":"20.8.0","_hasShrinkwrap":false,"peerDependencies":{"tslib":"2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/jdnconvertiblecalendar_0.0.1_1705670217165_0.4325821094876665","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@dasch-swiss/jdnconvertiblecalendar","version":"0.0.2","author":{"name":"Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors. Email to support@dasch.swiss."},"license":"Apache-2.0","_id":"@dasch-swiss/jdnconvertiblecalendar@0.0.2","maintainers":[{"name":"julien-dasch-swiss","email":"julien.schneider@dasch.swiss"},{"name":"mpro-dasch","email":"marcin.procyk@dasch.swiss"},{"name":"subotic","email":"ibs@subotic.ch"},{"name":"daschbot","email":"daschbot@dasch.swiss"}],"homepage":"https://github.com/dasch-swiss/dsp-app#readme","dist":{"shasum":"8e2d2cb4dbe6efa1edef51e3e95f9784e7a17b28","tarball":"https://registry.npmjs.org/@dasch-swiss/jdnconvertiblecalendar/-/jdnconvertiblecalendar-0.0.2.tgz","fileCount":33,"integrity":"sha512-Lxrq5kM0Ierd0/qLUPwevWELOv5J0k33FWyF1FKAOxGBCyyW8gEdSDbB508E5cYgkKKb2gGnu37NAlw+0lB5jw==","signatures":[{"sig":"MEUCIQDCrPiAxL5sKF3UJkxZuugIYpG9TuLEtu/1Rl1O/yN1bgIgbk/thXXyRdOGQrCflbYklPI69Nj9w6zXNSbopwwlEoA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103771},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"37cdbd28ba29d798734c22b396b1af1082f249b7","_npmUser":{"name":"julien-dasch-swiss","email":"julien.schneider@dasch.swiss"},"_npmVersion":"10.1.0","description":"## Introduction","directories":{},"_nodeVersion":"20.8.0","_hasShrinkwrap":false,"peerDependencies":{"tslib":">=2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/jdnconvertiblecalendar_0.0.2_1705673128278_0.07068120394822186","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@dasch-swiss/jdnconvertiblecalendar","version":"0.0.3","author":{"name":"Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors. Email to support@dasch.swiss."},"license":"Apache-2.0","_id":"@dasch-swiss/jdnconvertiblecalendar@0.0.3","maintainers":[{"name":"julien-dasch-swiss","email":"julien.schneider@dasch.swiss"},{"name":"mpro-dasch","email":"marcin.procyk@dasch.swiss"},{"name":"subotic","email":"ibs@subotic.ch"},{"name":"daschbot","email":"daschbot@dasch.swiss"}],"homepage":"https://github.com/dasch-swiss/dsp-app#readme","dist":{"shasum":"b06c9540228f8339aae4a387958cf191fe61057a","tarball":"https://registry.npmjs.org/@dasch-swiss/jdnconvertiblecalendar/-/jdnconvertiblecalendar-0.0.3.tgz","fileCount":33,"integrity":"sha512-cVtpEyLjsx2u3ElrTIAn0CcHQ6J731uPn7P6xv11pg7D8uzb/wYsZZu/OSC+W6EDfQvTQmuOMFucKcbpNZ8f7w==","signatures":[{"sig":"MEQCIELpEe+2OwnsXhvw6YaFvPJfud9ceg0JvguUf0WTE8B0AiA5Si1hdwUh3tjSwsCen93YTFYAtPMPtg4ViH0nNQwFEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":103666},"main":"./src/index.js","type":"commonjs","types":"./src/index.d.ts","gitHead":"d0b3325eb7b484891477cde688cbc8872abdf5d9","_npmUser":{"name":"julien-dasch-swiss","email":"julien.schneider@dasch.swiss"},"_npmVersion":"10.1.0","description":"## Introduction","directories":{},"_nodeVersion":"20.8.0","_hasShrinkwrap":false,"peerDependencies":{"tslib":">=2.6.1"},"_npmOperationalInternal":{"tmp":"tmp/jdnconvertiblecalendar_0.0.3_1705675646601_0.7941569559737316","host":"s3://npm-registry-packages"}}},"time":{"created":"2024-01-19T13:16:57.040Z","modified":"2026-04-20T08:12:24.139Z","0.0.1":"2024-01-19T13:16:57.316Z","0.0.2":"2024-01-19T14:05:28.432Z","0.0.3":"2024-01-19T14:47:26.799Z"},"author":{"name":"Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors. Email to support@dasch.swiss."},"license":"Apache-2.0","homepage":"https://github.com/dasch-swiss/dsp-app#readme","description":"## Introduction","maintainers":[{"email":"ibs@subotic.ch","name":"subotic"},{"email":"marcin.procyk@dasch.swiss","name":"mpro-dasch"},{"email":"julien.schneider@dasch.swiss","name":"julien-dasch-swiss"},{"email":"dominique.steinbach@dasch.swiss","name":"domsteinbach"},{"email":"bot@dasch.swiss","name":"bot-dasch-swiss"}],"readme":"# JDNConvertibleCalendar\n\n## Introduction\n\n`JDNConvertibleCalendar` offers a convenient way to convert a given date to other calendars making use of the *Julian Day*.\nThe Julian Day is the continuous count of days since the beginning of the Julian Period in 4713 BCE.\nThe Julian Day Count (JDC) contains a fraction that represents the daytime.\nA fraction of .5 represents midnight and .0 represents noon.\nFor example, the day with the date January 27th 1987 starts with the JDC of 2446822.5 and ends with a JDC of 2446823.4999…\nHence, noon is at 2446823.0.\nThe corresponding Julian Day Number (JDN) is at noon, which is 2446823 for the given example (January 27th 1987).\n\nFor more information about the Julian Day, see: Jean Meeus, Astronomical Algorithms, 1998, 59pp. and <https://en.wikipedia.org/wiki/Julian_day>\n\nPlease note that this software uses the (astronomical) convention that BCE dates are represented as negative years and that the year zero (0) is used.\nThis means that the year 1 BCE must be given as year 0,\nand the year 2 BCE corresponds to -1 etc.\n\nCurrently, the Gregorian, Julian, and Islamic calendars are supported.\n\n## Focus\n\nThe focus of this project is to provide a design or architecture that makes it easy to convert between calendars. It is, however, not primarily a library for astronomical algorithms.\nFor now, we put the these methods in the module `JDNConvertibleConversionModule`.\nWe would like to make this an separate module which could be used with `JDNConvertibleCalendar` (see <https://github.com/dhlab-basel/JDNConvertibleCalendar/issues/1>).\n\n## Design\n\n`JDNConvertibleCalendar` is an abstract class that can be implemented for various calendars, provided that those can be converted from and to a Julian Day.\n\nThe abstract base class offers a generic way to convert from and to any of its subclasses. Also calculations based on JDN are already implemented in the base class (shifting of a given period to the future or the past).\n\nAll dates are treated as periods. This allows for the handling of different precisions.\n\n## Adding more Calendars\n\nWhen adding a new subclass for `JDNConvertibleCalendar`, calendar specific methods have to be implemented, e.g., the conversion from and to the Julian Day.\nCalendar specific methods are declared abstract in the base class and have to be implemented when making a subclass. The new subclass has to be added to `supportedCalendars` (configuration array) and `convertCalendar` (conversion method) in `JDNConvertibleCalendar`.\n\n## Change from the Julian to the Gregorian Calendar\n\nIn order to reproduce BCE leap years and the respective length of the month February correctly\nwe have to distinguish between the Gregorian and Julian calendar when calculating the Julian Day Number.\nThe separating date is October 15th, 1582 when the Gregorian calendar was introduced in parts of Europe.\nPlease note that in the Gregorian calendar October 4th, 1582 is immediately followed by October 15th, 1582.\n\n## Scientific board\n\nThe project is scientifically accompanied by Rita Gautschy (University of Basel).\nShe reviewed the calendar conversion algorithms in `JDNConvertibleConversionModule` and provided an implementation in Fortran that allows for comparison of the results.\n\n## Documentation\n\nSee <https://dhlab-basel.github.io/JDNConvertibleCalendar/docs/index.html>.\n\n## Known Problems\n\n- The static configuration of how many months a year has per calendar may not be good enough for other calendars than Gregorian and Julian (lunar calendars).\n  Maybe this has to be made a function that returns the number of months for a given year. This would make transposing by month more complicated.\n\n## NPM Package\n\nThis project is available as an npm module: <https://www.npmjs.com/package/@dasch-swiss/jdnconvertiblecalendar>.\n\n## Integration in Angular Material\n\n`JDNConvertibleCalendar` can used with Angular Material (<https://material.angular.io>). Please see <https://www.npmjs.com/package/@dasch-swiss/jdnconvertiblecalendardateadapter> for more details.\n\n## Building\n\nRun `nx run jdnconvertiblecalendar:build` to build the library.\n\n## Running unit tests\n\nRun `nx run jdnconvertiblecalendar:test` to execute the unit tests via [Jest](https://jestjs.io).\n\n## Run a demo\n\nPlease see the README.md in this repository at `/apps/dateAdapter/README.md`\n","readmeFilename":"README.md"}