branch: elpa/datetime commit 5e74ece632b61bb183d2588f1a8592b5dac4a1ca Author: Paul Pogonyshev <pogonys...@gmail.com> Commit: Paul Pogonyshev <pogonys...@gmail.com>
Initial commit. --- .gitignore | 2 + LICENSE | 674 +++++++++++++++++++++++++++ README.md | 25 + datetime.el | 1264 ++++++++++++++++++++++++++++++++++++++++++++++++++ dev/HarvestData.java | 199 ++++++++ dev/harvest-data | 2 + 6 files changed, 2166 insertions(+) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..1e20817557 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.elc +dev/*.class diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000..94a9ed024d --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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. + + 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. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff --git a/README.md b/README.md new file mode 100644 index 0000000000..1d886e2285 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# datetime + +Datetime is a library for parsing, formatting, matching and recoding +timestamps and date-time format strings. It is written as a utility +for Logview, so currently most of functionality not needed for that +mode is *not implemented*. + + +### Pattern types + +There exist several different ways to specify date and/or time format. +Different programming language and their libraries use different +formats. E.g. format of date 2015-09-24 can be expressed at least in +the following ways: + + * `yyyy-MM-dd` ([ICU](http://userguide.icu-project.org/formatparse/datetime), [Java](https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html)) + + * `%Y-%m-%d` (POSIX, Emacs) + + * `Y-m-d` ([PHP](http://php.net/manual/en/function.date.php)) + +This library currently uses Java pattern format, but is internally +written in such a way that support for other types can be added +relatively easily. + diff --git a/datetime.el b/datetime.el new file mode 100644 index 0000000000..be2a7bc6c7 --- /dev/null +++ b/datetime.el @@ -0,0 +1,1264 @@ +;;; datetime.el --- Library for parsing, formatting and matching timestamps -*- lexical-binding: t -*- + +;; Copyright (C) 2016 Paul Pogonyshev + +;; Author: Paul Pogonyshev <pogonys...@gmail.com> +;; Maintainer: Paul Pogonyshev <pogonys...@gmail.com> +;; Version: 0.1 +;; Keywords: lisp, i18n +;; Homepage: https://github.com/doublep/datetime +;; Package-Requires: ((emacs "24.1")) + +;; 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. + +;; 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. +;; +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see http://www.gnu.org/licenses. + + +;;; Commentary: + +;; Library that provides support for formatting, parsing and matching +;; timestamps in certain format. + + +;;; Code: + + +;; Internally any date-time pattern is parsed to a list of value pairs +;; (type . details). Type is a symbol, while details are either nil, +;; another symbol or a number that represents minimum number of +;; characters in formatted number (left padded with zeros). The only +;; exception is "as-is" part: it is just a string, not a cons cell. +;; +;; Here are all currently used types with details in parentheses, +;; grouped roughly by represented date-time value. Context/standalone +;; is meaningful for languages that involve flexing, for English they +;; are the same. +;; +;; In all cases these should be seen as internals and can be changed +;; in a future library versions without prior notice. +;; +;; era (full | abbreviated) --- AD or BC +;; +;; year (add-century-when-parsing | always-two-digits | NUMBER) +;; - add-century-when-parsing: format as-is, but when parsing add +;; century if exactly two digits; +;; year-for-week (same as for year) +;; +;; month (NUMBER) +;; month-context-name (full | abbreviated) +;; month-standalone-name (full | abbreviated) +;; +;; week-in-year (NUMBER) +;; week-in-month (NUMBER) +;; +;; day-in-year (NUMBER) +;; day-in-month (NUMBER) +;; weekday-in-month (NUMBER) +;; e.g. would be 2 for 2015-09-09, because it is the second +;; Wednesday that month; +;; weekday (NUMBER) +;; weekday-context-name (full | abbreviated) +;; weekday-standalone-name (full | abbreviated) +;; +;; am/pm (full | abbreviated) +;; +;; hour-0-23 (NUMBER) +;; hour-1-24 (NUMBER) +;; hour-am/pm-0-11 (NUMBER) +;; hour-am/pm-1-12 (NUMBER) +;; +;; minute (NUMBER) +;; second (NUMBER) +;; millisecond (NUMBER) +;; second-fractional (NUMBER) +;; this is a generalization used internally: (second-fractional . 3) +;; means millis, (second-fractional . 6) -- micros, and so on. +;; +;; timezone (?) -- currently not supported further than pattern parsing + + +(define-error 'datetime-unsupported-timezone "Timezones are currently not supported") + + +(defvar datetime--pattern-parsers '((parsed . (lambda (pattern options) pattern)) + (java . datetime--parse-java-pattern))) + +(defvar datetime--pattern-formatters '((parsed . (lambda (parts options) parts)) + (java . datetime--format-java-pattern))) + + +(defun datetime--parse-pattern (type pattern options) + (let ((parser (cdr (assq type datetime--pattern-parsers)))) + (if parser + (funcall parser pattern options) + (error "Unknown pattern type `%s'" type)))) + +(defun datetime--format-pattern (type parts options) + (let ((formatter (cdr (assq type datetime--pattern-formatters)))) + (if formatter + (funcall formatter parts options) + (error "Unknown pattern type `%s'" type)))) + + +;; Appending character-by-character is slow, but pretty sure it +;; doesn't matter for generally short date-time patterns. +(defmacro datetime--extend-as-is-part (parts text) + `(let ((text ,text)) + (if (stringp (car ,parts)) + (setcar parts (concat (car ,parts) text)) + (push text ,parts)))) + + +(defun datetime--parse-java-pattern (pattern options) + (let ((scan 0) + (length (length pattern)) + parts) + (while (< scan length) + (let ((character (aref pattern scan)) + (num-repetitions 1)) + (setq scan (1+ scan)) + (cond ((= character ?') + (when (= scan length) + (error "Unterminated quote")) + ;; Ugly code to parse single-quoted string. + (if (= (aref pattern scan) ?') + (progn + (datetime--extend-as-is-part parts "'") + (setq scan (1+ scan))) + (while (progn + (when (= scan length) + (error "Unterminated quote")) + (setq character (aref pattern scan) + scan (1+ scan)) + (if (/= character ?') + (datetime--extend-as-is-part parts (string character)) + (when (and (< scan length) (= (aref pattern scan) ?')) + (datetime--extend-as-is-part parts (string ?')) + (setq scan (1+ scan)))))))) + ((or (and (<= ?A character) (<= character ?Z)) (and (<= ?a character) (<= character ?z))) + (while (and (< scan length) (eq (aref pattern scan) character)) + (setq scan (1+ scan) + num-repetitions (1+ num-repetitions))) + (pcase character + ((or ?G ?E ?a) + (push (cons (pcase character + (?G 'era) + (?E 'weekday-context-name) + (?a 'am/pm)) + (if (>= num-repetitions 4) 'full 'abbreviated)) + parts)) + ((or ?y ?Y) + (push (cons (if (= character ?y) 'year 'year-for-week) + (pcase num-repetitions + (1 'add-century-when-parsing) + (2 'always-two-digits) + (_ num-repetitions))) + parts)) + ((or ?M ?L) + (push (if (<= num-repetitions 2) + (cons 'month num-repetitions) + (cons (if (= character ?M) 'month-context-name 'month-standalone-name) + (if (>= num-repetitions 4) 'full 'abbreviated))) + parts)) + (?w (push (cons 'week-in-year num-repetitions) parts)) + (?W (push (cons 'week-in-month num-repetitions) parts)) + (?D (push (cons 'day-in-year num-repetitions) parts)) + (?d (push (cons 'day-in-month num-repetitions) parts)) + (?F (push (cons 'weekday-in-month num-repetitions) parts)) + (?H (push (cons 'hour-0-23 num-repetitions) parts)) + (?k (push (cons 'hour-1-24 num-repetitions) parts)) + (?K (push (cons 'hour-am/pm-0-11 num-repetitions) parts)) + (?h (push (cons 'hour-am/pm-1-12 num-repetitions) parts)) + (?m (push (cons 'minute num-repetitions) parts)) + (?s (push (cons 'second num-repetitions) parts)) + (?S (push (cons (if (plist-get options :second-fractional-extension) 'second-fractional 'millisecond) + num-repetitions) + parts)) + (?z (push (cons 'timezone 'general) parts)) + (?Z (push (cons 'timezone 'rfc-822) parts)) + (?X (push (cons 'timezone 'iso-8601) parts)) + (_ + (error "Illegal pattern character `%c'" character)))) + (t + (datetime--extend-as-is-part parts (string character)))))) + (nreverse parts))) + +(defun datetime--format-java-pattern (parts options) + (let ((case-fold-search nil) + strings) + (dolist (part parts) + (if (stringp part) + (progn + (when (string-match "\\`'+" part) + (push (concat (match-string-no-properties 0) (match-string-no-properties 0)) strings) + (setq part (substring part (match-end 0)))) + (when (> (length part) 0) + (push (if (string-match "['[:alpha:]]" part) + ;; TODO: Might want to prettify a bit. + (concat "'" (replace-regexp-in-string "'" "''" part t t) "'") + part) + strings))) + (let* ((type (car part)) + (details (cdr part)) + (string (pcase type + (`era "G") + ((or `year `year-for-week) + (let ((base (if (eq type 'year) ?y ?Y))) + (pcase details + (`add-century-when-parsing base) + (`always-two-digits (cons base 2)) + (_ (cons base details))))) + (`month (cons ?M details)) + ((or `month-context-name `month-standalone-name `weekday-context-name) + (cons (pcase type + (`month-context-name ?M) + (`month-standalone-name ?L) + (`weekday-context-name ?E)) + (pcase details + (`abbreviated 3) + (`full 4) + (_ (error "Unexpected details %s" details))))) + (`week-in-year (cons ?w details)) + (`week-in-month (cons ?W details)) + (`day-in-year (cons ?D details)) + (`day-in-month (cons ?d details)) + (`weekday-in-month (cons ?F details)) + (`hour-0-23 (cons ?H details)) + (`hour-1-24 (cons ?k details)) + (`hour-am/pm-0-11 (cons ?K details)) + (`hour-am/pm-1-12 (cons ?h details)) + (`minute (cons ?m details)) + (`second (cons ?s details)) + (`millisecond (cons ?S details)) + (`second-fractional (if (plist-get options :second-fractional-extension) + (cons ?S details) + (error "`second-fractional' extension is not enabled"))) + (`am/pm "a") + (_ (error "Unexpected part type %s" type))))) + (push (cond ((integerp string) + (string string)) + ((consp string) + (unless (integerp (cdr string)) + (error "Unexpected details %s" (cdr string))) + (make-string (cdr string) (car string))) + (t + string)) + strings)))) + (apply #'concat (nreverse strings)))) + + +(defun datetime-matching-regexp (type pattern &rest options) + "Return a regexp that matches date-time according to the PATTERN. +Argument TYPE defines how the pattern should be interpreted, see +library documentation. Rest of the arguments must be a property +list, i.e. keywords interleaved with values. + +Returned regexp contains only \"shy\" groups, so it can be +inserted into a larger one without screwing group ordering. Note +that the returned regexp as a whole is not enclosed in a group; +when inserting you need to take that into account where +necessarily. + +Note that the returned regexp will match some incorrect dates +too. It is supposed to be used as a good and fast estimation if +a string represents date-time formatted according to PATTERN, but +it is not strict enough to be used as a validator. + +OPTIONS should be any keyword arguments understood by +`datetime-recode-pattern' plus any from the list below, specific +to this function. + +The function understands several keyword arguments to subtly +tweak the produced regexp. Many of these flags can be used to +discard valid date-time strings. They are still useful because +\"can be parsed\" is not necessarily equal to \"valid in this +context\". Default value of keyword arguments is nil unless +specified otherwise. + + :locale + + Locale (language) used for month, weekday etc. names. Always + defaults to English, even if system locale is different. + + :only-4-digit-years + + Match only four consecutive digits as a year. By default any + number of digits will be accepted. + + :lax-whitespace + + Match any whitespace in PATTERN against any whitespace in + date-time string. For this purpose \"whitespace\" is defined + as space and tab characters only. + + :accept-leading-space + + Make variable-width numbers (e.g. day number without leading + zero) match also if there is a leading space. + + :require-leading-zeros + + Make numbers that are formatted with leading zeros in PATTERN + only match when there are corresponding zeros in the string. + + :forbid-unnecessary-zeros + + Don't match more leading zeros than required by the pattern. + E.g. \"030 September\" is a valid date, but no-one writes it + like that and with this flag such strings are not matched." + (let* ((lax-whitespace (plist-get options :lax-whitespace)) + (locale (or (plist-get options :locale) 'en)) + regexp-parts) + (dolist (part (datetime--parse-pattern type pattern options)) + (if (stringp part) + (push (if lax-whitespace + (replace-regexp-in-string (rx (1+ (any blank))) (rx (1+ (any blank))) (regexp-quote part) t t) + (regexp-quote part)) + regexp-parts) + (let* ((type (car part)) + (details (cdr part)) + (regexp (pcase type + (`era (regexp-opt (append (datetime-locale-field locale :era) nil))) + ((or `year `year-for-week) + (if (plist-get options :only-4-digit-years) + (rx (= 4 (any "0-9"))) + (rx (1+ (any "0-9"))))) + (`month 12) + (`month-context-name + (regexp-opt (append (datetime-locale-field locale (if (eq details 'abbreviated) + :month-context-abbr + :month-context-names)) + nil))) + (`month-standalone-name + (regexp-opt (append (datetime-locale-field locale (if (eq details 'abbreviated) + :month-standalone-abbr + :month-standalone-names)) + nil))) + (`week-in-year 53) + (`week-in-month 5) + (`day-in-month 31) + (`weekday-in-month 5) + (`weekday 7) + (`weekday-context-name + (regexp-opt (append (datetime-locale-field locale (if (eq details 'abbreviated) + :weekday-context-abbr + :weekday-context-names)) + nil))) + (`weekday-standalone-name + (regexp-opt (append (datetime-locale-field locale (if (eq details 'abbreviated) + :weekday-standalone-abbr + :weekday-standalone-names)) + nil))) + (`am/pm + (regexp-opt (append (datetime-locale-field locale :am/pm) nil))) + (`hour-0-23 23) + (`hour-1-24 24) + (`hour-am/pm-0-11 11) + (`hour-am/pm-1-12 12) + (`minute 59) + (`second 59) + ((or `millisecond `second-fractional) + (apply #'concat (make-list details (rx (any "0-9"))))) + (`timezone + (signal 'datetime-unsupported-timezone nil)) + ((pred stringp) + (regexp-quote type)) + (_ (error "Unexpected value %s" type))))) + (when (integerp regexp) + ;; REGEXP is really the maximum value of this one- or + ;; two-digit number. + (setq regexp (if (<= regexp 9) + (cond ((and (>= details 2) (plist-get options :require-leading-zeros) + (format "%s[1-%d]" (make-string (- details 1) ?0) regexp))) + ((plist-get options :forbid-unnecessary-zeros) + (format "[1-%d]" regexp)) + (t + (format "0*[1-%d]" regexp))) + (cond ((and (= details 1) (plist-get options :accept-leading-space)) + (format "[ 0-%d]?[0-9]" (/ regexp 10))) + ((and (>= details 2) (plist-get options :require-leading-zeros) + (format "%s[0-%d][0-9]" (make-string (- details 2) ?0) (/ regexp 10)))) + ((plist-get options :forbid-unnecessary-zeros) + (format "[0-%d]?[0-9]" (/ regexp 10))) + ((>= regexp 20) + (format "0*[1-%d]?[0-9]" (/ regexp 10))) + (t + "0*1?[0-9]"))))) + (push regexp regexp-parts)))) + (apply #'concat (nreverse regexp-parts)))) + + +(defun datetime-recode-pattern (from to pattern &rest options) + "Recode PATTERN between two supported types. +As a special case, either of FROM and TO can be set to 'parsed. +This is useful as a speed optimization in a few cases where you +perform several transformations on the same pattern. + +Options can be a list of the following keyword arguments: + + :second-fractional-extension + + In Java patterns any number of \"S\" stand for milliseconds. + With this extension they are instead interpreted according to + how many \"S\" there is, e.g. \"SSSSSS\" means microseconds." + (datetime--format-pattern to (datetime--parse-pattern from pattern options) options)) + + +;; Arguments are expected to be atoms. +(defmacro datetime--pattern-includes-p (type pattern &rest part-types) + `(let ((parts (datetime--parse-pattern ,type ,pattern nil)) + includes) + (while parts + (let ((part (car parts))) + (if (and (consp part) ,(if (= (length part-types) 1) + `(eq (car part) ',(car part-types)) + `(memq (car part) ',part-types))) + (setq parts nil + includes t) + (setq parts (cdr parts))))) + includes)) + +(defun datetime-pattern-locale-dependent-p (type pattern) + "Determine if PATTERN includes any locale-based parts. +In other words, return non-nil if PATTERN includes any textual +names." + (datetime--pattern-includes-p type pattern era month-context-name month-standalone-name weekday-context-name weekday-standalone-name am/pm)) + +(defun datetime-pattern-includes-era-p (type pattern) + "Determine if PATTERN includes the date era." + (datetime--pattern-includes-p type pattern era)) + +(defun datetime-pattern-includes-year-p (type pattern) + "Determine if PATTERN includes the year." + (datetime--pattern-includes-p type pattern year year-for-week)) + +(defun datetime-pattern-includes-month-p (type pattern) + "Determine if PATTERN includes the month." + (datetime--pattern-includes-p type pattern month month-context-name month-standalone-name)) + +(defun datetime-pattern-includes-day-p (type pattern) + "Determine if PATTERN includes the day." + (datetime--pattern-includes-p type pattern day-in-year day-in-month)) + +(defun datetime-pattern-includes-hour-p (type pattern) + "Determine if PATTERN includes hours." + (datetime--pattern-includes-p type pattern hour-0-23 hour-1-24 hour-am/pm-0-11 hour-am/pm-1-12)) + +(defun datetime-pattern-includes-minute-p (type pattern) + "Determine if PATTERN includes minutes." + (datetime--pattern-includes-p type pattern minute)) + +(defun datetime-pattern-includes-second-p (type pattern) + "Determine if PATTERN includes seconds." + (datetime--pattern-includes-p type pattern second)) + +(defun datetime-pattern-includes-millisecond-p (type pattern) + "Determine if PATTERN includes fractions of seconds." + ;; Without enabled :second-fractional-extension consecutive "S" are + ;; just always parsed to milliseconds. Check for + ;; `second-fractional' just in case of another pattern type. + (datetime--pattern-includes-p type pattern millisecond second-fractional)) + +(defun datetime-pattern-includes-timezone-p (type pattern) + "Determine if PATTERN includes timezone." + (datetime--pattern-includes-p type pattern timezone)) + + +(defun datetime-list-locales (&optional include-variants) + "List all locales for which the library has information. +If INCLUDE-VARIANTS is nil, only include “base” locales (in +format \"xx\"), if it is t then also include “variants” in format +\"xx-YY\". + +Return value is a list of symbols; it can be modified freely." + (let (locales) + (dolist (data datetime--locale-data) + (when (or include-variants (<= (length (symbol-name (car data))) 2)) + (push (car data) locales))) + (nreverse locales))) + + +(defsubst datetime--do-get-locale-pattern (patterns variant) + (or (plist-get patterns variant) + (unless (eq variant :medium) (plist-get patterns :medium)) + (when (eq variant :full) (plist-get patterns :long)))) + +(defun datetime-locale-date-pattern (locale &optional variant) + "Get given date pattern for the LOCALE. +Supported variants are `:short', `:medium', `:long' and `:full'. +If no VARIANT is specified, it defaults to `:medium'. + +Returned pattern is always of type \\\='java." + (datetime--do-get-locale-pattern (datetime-locale-field locale :date-patterns) (or variant :medium))) + +(defun datetime-locale-time-pattern (locale &optional variant) + "Get given time pattern for the LOCALE. +Supported variants are `:short', `:medium', `:long' and `:full'. +If no VARIANT is specified, it defaults to `:medium'. + +Returned pattern is always of type \\\='java." + (datetime--do-get-locale-pattern (datetime-locale-field locale :time-patterns) (or variant :medium))) + +(defun datetime-locale-date-time-pattern (locale &optional date-variant time-variant) + "Get given date-time pattern for the LOCALE. +Supported variants are `:short', `:medium', `:long' and `:full'. +If DATE-VARIANT is not specified, it defaults to `:medium'. If +TIME-VARIANT is not specified, it defaults to DATE-VARIANT (or +`:medium' it that's missing too). + +Returned pattern is always of type \\\='java. + +This function exists not just for completeness: while in most +cases the result is just corresponding date and time patterns +separated by a space, for a few locales it is different." + (let ((date-time-pattern-rule (datetime-locale-field locale :date-time-pattern-rule)) + (date-part (datetime-locale-date-pattern locale date-variant)) + (time-part (datetime-locale-time-pattern locale (or time-variant date-variant)))) + (if (car date-time-pattern-rule) + (concat date-part (cdr date-time-pattern-rule) time-part) + (concat time-part (cdr date-time-pattern-rule) date-part)))) + + +(defconst datetime--english-eras ["BC" "AD"]) +(defconst datetime--english-am-pm ["AM" "PM"]) + +(defsubst datetime--do-get-locale-field (locale-data field) + (or (plist-get locale-data field) + ;; See `datetime--locale-data' for description of fallbacks. + (pcase field + (:decimal-separator ?.) + (:eras datetime--english-eras) + (:month-standalone-abbr (plist-get locale-data :month-context-abbr)) + (:month-standalone-names (plist-get locale-data :month-context-names)) + (:weekday-standalone-abbr (plist-get locale-data :weekday-context-abbr)) + (:weekday-standalone-names (plist-get locale-data :weekday-context-names)) + (:am/pm datetime--english-am-pm)))) + +(defun datetime-locale-field (locale field) + "Get a FIELD of data for the LOCALE. +Supported fields: + + :decimal-separator + :eras + :month-context-abbr + :month-context-names + :weekday-context-abbr + :weekday-context-names + :month-standalone-abbr + :month-standalone-names + :weekday-standalone-abbr + :weekday-standalone-names + :am-pm" + ;; Additionally `:date-patterns', `:time-patterns' and + ;; `:date-time-pattern-rule' are supported for internal use. + (or (datetime--do-get-locale-field (cdr (assq locale datetime--locale-data)) field) + (let ((name (symbol-name locale))) + (when (> (length name) 3) + (datetime--do-get-locale-field (cdr (assq (intern (substring name 0 2)) datetime--locale-data)) field))))) + + +;; Extracted from Java using `dev/HarvestData.java'. All patterns are +;; obviously of java type. +;; +;; There are many fallbacks involved to reduce size of this alist: +;; - for locale XX-YY value for any property defaults to that of +;; locale XX; +;; - `:decimal-separator' defaults to dot; +;; - `:eras' and `:am-pm' default to English version; +;; - month/dayweek standalone abbreviations or names default to +;; the corresponding context-aware property; +;; - date-time patterns are not stored, instead they are built from +;; date and time parts for that locale; corresponding field is a +;; cons with car determining what should be in the beginning (t +;; for date, nil for time), and cdr being the separator string; +;; - all patterns have the following fallbacks: `:short' defaults to +;; `:medium', `:long' defaults to `:medium', `:full' defaults to +;; `:long'. +(defvar datetime--locale-data + '((ar + :eras ["ق.م" "م"] + :month-context-abbr ["ينا" "فبر" "مار" "أبر" "ماي" "يون" "يول" "أغس" "سبت" "أكت" "نوف" "ديس"] + :month-context-names ["يناير" "فبراير" "مارس" "أبريل" "مايو" "يونيو" "يوليو" "أغسطس" "سبتمبر" "أكتوبر" "نوفمبر" "ديسمبر"] + :weekday-context-abbr ["ن" "ث" "ر" "خ" "ج" "س" "ح"] + :weekday-context-names ["الاثنين" "الثلاثاء" "الأربعاء" "الخميس" "الجمعة" "السبت" "الأحد"] + :am-pm ["ص" "م"] + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "dd MMMM, yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "z hh:mm:ss a") + :date-time-pattern-rule (t . " ")) + (ar-JO + :month-context-abbr ["كانون الثاني" "شباط" "آذار" "نيسان" "نوار" "حزيران" "تموز" "آب" "أيلول" "تشرين الأول" "تشرين الثاني" "كانون الأول"] + :month-context-names ["كانون الثاني" "شباط" "آذار" "نيسان" "نوار" "حزيران" "تموز" "آب" "أيلول" "تشرين الأول" "تشرين الثاني" "كانون الأول"] + :weekday-context-abbr ["الاثنين" "الثلاثاء" "الأربعاء" "الخميس" "الجمعة" "السبت" "الأحد"]) + (ar-LB + :month-context-abbr ["كانون الثاني" "شباط" "آذار" "نيسان" "نوار" "حزيران" "تموز" "آب" "أيلول" "تشرين الأول" "تشرين الثاني" "كانون الأول"] + :month-context-names ["كانون الثاني" "شباط" "آذار" "نيسان" "نوار" "حزيران" "تموز" "آب" "أيلول" "تشرين الأول" "تشرين الثاني" "كانون الأول"] + :weekday-context-abbr ["الاثنين" "الثلاثاء" "الأربعاء" "الخميس" "الجمعة" "السبت" "الأحد"]) + (ar-SY + :month-context-abbr ["كانون الثاني" "شباط" "آذار" "نيسان" "نوار" "حزيران" "تموز" "آب" "أيلول" "تشرين الأول" "تشرين الثاني" "كانون الأول"] + :month-context-names ["كانون الثاني" "شباط" "آذار" "نيسان" "نواران" "حزير" "تموز" "آب" "أيلول" "تشرين الأول" "تشرين الثاني" "كانون الأول"] + :weekday-context-abbr ["الاثنين" "الثلاثاء" "الأربعاء" "الخميس" "الجمعة" "السبت" "الأحد"]) + (be + :decimal-separator ?, + :eras ["да н.е." "н.е."] + :month-context-abbr ["стд" "лют" "скв" "крс" "май" "чрв" "лпн" "жнв" "врс" "кст" "ліс" "снж"] + :month-context-names ["студзеня" "лютага" "сакавіка" "красавіка" "мая" "чрвеня" "ліпеня" "жніўня" "верасня" "кастрычніка" "лістапада" "снежня"] + :weekday-context-abbr ["пн" "ат" "ср" "чц" "пт" "сб" "нд"] + :weekday-context-names ["панядзелак" "аўторак" "серада" "чацвер" "пятніца" "субота" "нядзеля"] + :date-patterns (:short "d.M.yy" :medium "d.M.yyyy" :long "EEEE, d, MMMM yyyy") + :time-patterns (:short "H.mm" :medium "H.mm.ss" :long "H.mm.ss z") + :date-time-pattern-rule (t . " ")) + (bg + :decimal-separator ?, + :eras ["пр.н.е." "н.е."] + :month-context-abbr ["I" "II" "III" "IV" "V" "VI" "VII" "VIII" "IX" "X" "XI" "XII"] + :month-context-names ["Януари" "Февруари" "Март" "Април" "Май" "Юни" "Юли" "Август" "Септември" "Октомври" "Ноември" "Декември"] + :weekday-context-abbr ["Пн" "Вт" "Ср" "Чт" "Пт" "Сб" "Нд"] + :weekday-context-names ["Понеделник" "Вторник" "Сряда" "Четвъртък" "Петък" "Събота" "Неделя"] + :date-patterns (:short "dd.MM.yy" :medium "dd.MM.yyyy" :long "dd MMMM y" :full "dd MMMM y, EEEE") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "HH:mm:ss zzzz") + :date-time-pattern-rule (t . " ")) + (ca + :decimal-separator ?, + :month-context-abbr ["de gen." "de febr." "de març" "d’abr." "de maig" "de juny" "de jul." "d’ag." "de set." "d’oct." "de nov." "de des."] + :month-context-names ["de gener" "de febrer" "de març" "d’abril" "de maig" "de juny" "de juliol" "d’agost" "de setembre" "d’octubre" "de novembre" "de desembre"] + :weekday-context-abbr ["dl." "dt." "dc." "dj." "dv." "ds." "dg."] + :weekday-context-names ["dilluns" "dimarts" "dimecres" "dijous" "divendres" "dissabte" "diumenge"] + :month-standalone-abbr ["gen." "feb." "març" "abr." "maig" "juny" "jul." "ag." "set." "oct." "nov." "des."] + :month-standalone-names ["gener" "febrer" "març" "abril" "maig" "juny" "juliol" "agost" "setembre" "octubre" "novembre" "desembre"] + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' / 'MMMM' / 'yyyy" :full "EEEE, d' / 'MMMM' / 'yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (cs + :decimal-separator ?, + :eras ["př.Kr." "po Kr."] + :month-context-abbr ["Led" "Úno" "Bře" "Dub" "Kvě" "Čer" "Čvc" "Srp" "Zář" "Říj" "Lis" "Pro"] + :month-context-names ["ledna" "února" "března" "dubna" "května" "června" "července" "srpna" "září" "října" "listopadu" "prosince"] + :weekday-context-abbr ["Po" "Út" "St" "Čt" "Pá" "So" "Ne"] + :weekday-context-names ["Pondělí" "Úterý" "Středa" "Čtvrtek" "Pátek" "Sobota" "Neděle"] + :month-standalone-abbr ["I" "II" "III" "IV" "V" "VI" "VII" "VIII" "IX" "X" "XI" "XII"] + :month-standalone-names ["leden" "únor" "březen" "duben" "květen" "červen" "červenec" "srpen" "září" "říjen" "listopad" "prosinec"] + :am-pm ["dop." "odp."] + :date-patterns (:short "d.M.yy" :medium "d.M.yyyy" :long "d. MMMM yyyy" :full "EEEE, d. MMMM yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z") + :date-time-pattern-rule (t . " ")) + (da + :decimal-separator ?, + :eras ["f.Kr." "e.Kr."] + :month-context-abbr ["jan." "feb." "mar." "apr." "maj" "jun." "jul." "aug." "sep." "okt." "nov." "dec."] + :month-context-names ["januar" "februar" "marts" "april" "maj" "juni" "juli" "august" "september" "oktober" "november" "december"] + :weekday-context-abbr ["ma" "ti" "on" "to" "fr" "lø" "sø"] + :weekday-context-names ["mandag" "tirsdag" "onsdag" "torsdag" "fredag" "lørdag" "søndag"] + :month-standalone-abbr ["jan" "feb" "mar" "apr" "maj" "jun" "jul" "aug" "sep" "okt" "nov" "dec"] + :date-patterns (:short "dd-MM-yy" :medium "dd-MM-yyyy" :long "d. MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (de + :decimal-separator ?, + :eras ["v. Chr." "n. Chr."] + :month-context-abbr ["Jan" "Feb" "Mär" "Apr" "Mai" "Jun" "Jul" "Aug" "Sep" "Okt" "Nov" "Dez"] + :month-context-names ["Januar" "Februar" "März" "April" "Mai" "Juni" "Juli" "August" "September" "Oktober" "November" "Dezember"] + :weekday-context-abbr ["Mo" "Di" "Mi" "Do" "Fr" "Sa" "So"] + :weekday-context-names ["Montag" "Dienstag" "Mittwoch" "Donnerstag" "Freitag" "Samstag" "Sonntag"] + :month-standalone-abbr ["Jan" "Feb" "Mrz" "Apr" "Mai" "Jun" "Jul" "Aug" "Sep" "Okt" "Nov" "Dez"] + :date-patterns (:short "dd.MM.yy" :medium "dd.MM.yyyy" :long "d. MMMM yyyy" :full "EEEE, d. MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "HH:mm' Uhr 'z") + :date-time-pattern-rule (t . " ")) + (de-AT + :month-context-abbr ["Jän" "Feb" "Mär" "Apr" "Mai" "Jun" "Jul" "Aug" "Sep" "Okt" "Nov" "Dez"] + :month-context-names ["Jänner" "Februar" "März" "April" "Mai" "Juni" "Juli" "August" "September" "Oktober" "November" "Dezember"] + :date-patterns (:short "dd.MM.yy" :medium "dd.MM.yyyy" :long "dd. MMMM yyyy" :full "EEEE, dd. MMMM yyyy")) + (de-CH) + (el + :decimal-separator ?, + :month-context-abbr ["Ιαν" "Φεβ" "Μαρ" "Απρ" "Μαϊ" "Ιουν" "Ιουλ" "Αυγ" "Σεπ" "Οκτ" "Νοε" "Δεκ"] + :month-context-names ["Ιανουαρίου" "Φεβρουαρίου" "Μαρτίου" "Απριλίου" "Μαΐου" "Ιουνίου" "Ιουλίου" "Αυγούστου" "Σεπτεμβρίου" "Οκτωβρίου" "Νοεμβρίου" "Δεκεμβρίου"] + :weekday-context-abbr ["Δευ" "Τρι" "Τετ" "Πεμ" "Παρ" "Σαβ" "Κυρ"] + :weekday-context-names ["Δευτέρα" "Τρίτη" "Τετάρτη" "Πέμπτη" "Παρασκευή" "Σάββατο" "Κυριακή"] + :month-standalone-abbr ["Ιαν" "Φεβ" "Μάρ" "Απρ" "Μάι" "Ιούν" "Ιούλ" "Αυγ" "Σεπ" "Οκτ" "Νοέ" "Δεκ"] + :month-standalone-names ["Ιανουάριος" "Φεβρουάριος" "Μάρτιος" "Απρίλιος" "Μάϊος" "Ιούνιος" "Ιούλιος" "Αύγουστος" "Σεπτέμβριος" "Οκτώβριος" "Νοέμβριος" "Δεκέμβριος"] + :am-pm ["πμ" "μμ"] + :date-patterns (:short "d/M/yyyy" :medium "d MMM yyyy" :long "d MMMM yyyy" :full "EEEE, d MMMM yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :long "h:mm:ss a z") + :date-time-pattern-rule (t . " ")) + (el-CY + :eras ["π.Χ." "μ.Χ."] + :month-context-names ["Ιανουάριος" "Φεβρουάριος" "Μάρτιος" "Απρίλιος" "Μάιος" "Ιούνιος" "Ιούλιος" "Αύγουστος" "Σεπτέμβριος" "Οκτώβριος" "Νοέμβριος" "Δεκέμβριος"] + :am-pm ["ΠΜ" "ΜΜ"] + :date-patterns (:short "dd/MM/yyyy" :medium "dd MMM yyyy" :long "dd MMMM yyyy" :full "EEEE, dd MMMM yyyy")) + (en + :month-context-abbr ["Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"] + :month-context-names ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"] + :weekday-context-abbr ["Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"] + :weekday-context-names ["Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday"] + :date-patterns (:short "M/d/yy" :medium "MMM d, yyyy" :long "MMMM d, yyyy" :full "EEEE, MMMM d, yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :long "h:mm:ss a z") + :date-time-pattern-rule (t . " ")) + (en-AU + :date-patterns (:short "d/MM/yy" :medium "dd/MM/yyyy" :long "d MMMM yyyy" :full "EEEE, d MMMM yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :full "h:mm:ss a z")) + (en-CA + :date-patterns (:short "dd/MM/yy" :medium "d-MMM-yyyy" :long "MMMM d, yyyy" :full "EEEE, MMMM d, yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :long "h:mm:ss z a" :full "h:mm:ss 'o''clock' a z")) + (en-GB + :date-patterns (:short "dd/MM/yy" :medium "dd-MMM-yyyy" :long "dd MMMM yyyy" :full "EEEE, d MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "HH:mm:ss 'o''clock' z")) + (en-IE + :date-patterns (:short "dd/MM/yy" :medium "dd-MMM-yyyy" :long "dd MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "HH:mm:ss 'o''clock' z")) + (en-IN + :date-patterns (:short "d/M/yy" :medium "d MMM, yyyy" :long "d MMMM, yyyy" :full "EEEE, d MMMM, yyyy")) + (en-MT + :date-patterns (:short "dd/MM/yyyy" :medium "dd MMM yyyy" :long "dd MMMM yyyy" :full "EEEE, d MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z")) + (en-NZ + :date-patterns (:short "d/MM/yy" :medium "d/MM/yyyy" :long "d MMMM yyyy" :full "EEEE, d MMMM yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :full "h:mm:ss a z")) + (en-PH + :date-patterns (:short "M/d/yy" :medium "MM d, yy" :long "MMMM d, yyyy" :full "EEEE, MMMM d, yyyy")) + (en-ZA + :date-patterns (:short "yyyy/MM/dd" :medium "dd MMM yyyy" :long "dd MMMM yyyy" :full "EEEE dd MMMM yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a")) + (es + :decimal-separator ?, + :eras ["antes de Cristo" "anno Dómini"] + :month-context-abbr ["ene" "feb" "mar" "abr" "may" "jun" "jul" "ago" "sep" "oct" "nov" "dic"] + :month-context-names ["enero" "febrero" "marzo" "abril" "mayo" "junio" "julio" "agosto" "septiembre" "octubre" "noviembre" "diciembre"] + :weekday-context-abbr ["lun" "mar" "mié" "jue" "vie" "sáb" "dom"] + :weekday-context-names ["lunes" "martes" "miércoles" "jueves" "viernes" "sábado" "domingo"] + :date-patterns (:short "d/MM/yy" :medium "dd-MMM-yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "HH'H'mm'' z") + :date-time-pattern-rule (t . " ")) + (es-AR + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "H:mm:ss z" :full "HH'h'''mm z")) + (es-BO + :date-patterns (:short "dd-MM-yy" :medium "dd-MM-yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-CL + :date-patterns (:short "dd-MM-yy" :medium "dd-MM-yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "HH:mm:ss zzzz")) + (es-CO + :date-patterns (:short "d/MM/yy" :medium "d/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-CR + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-DO + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-EC + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "HH:mm:ss zzzz")) + (es-GT + :date-patterns (:short "d/MM/yy" :medium "d/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-HN + :date-patterns (:short "MM-dd-yy" :medium "MM-dd-yyyy" :long "dd' de 'MMMM' de 'yyyy" :full "EEEE dd' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-MX + :date-patterns (:short "d/MM/yy" :medium "d/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-NI + :date-patterns (:short "MM-dd-yy" :medium "MM-dd-yyyy" :long "dd' de 'MMMM' de 'yyyy" :full "EEEE dd' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-PA + :date-patterns (:short "MM/dd/yy" :medium "MM/dd/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-PE + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-PR + :date-patterns (:short "MM-dd-yy" :medium "MM-dd-yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-PY + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-SV + :date-patterns (:short "MM-dd-yy" :medium "MM-dd-yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-US + :eras ["a.C." "d.C."] + :am-pm ["a.m." "p.m."] + :date-patterns (:short "M/d/yy" :medium "MMM d, yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :long "h:mm:ss a z")) + (es-UY + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (es-VE + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE d' de 'MMMM' de 'yyyy") + :time-patterns (:short "hh:mm a" :medium "hh:mm:ss a" :long "hh:mm:ss a z")) + (et + :decimal-separator ?, + :eras ["e.m.a." "m.a.j."] + :month-context-abbr ["jaan" "veebr" "märts" "apr" "mai" "juuni" "juuli" "aug" "sept" "okt" "nov" "dets"] + :month-context-names ["jaanuar" "veebruar" "märts" "aprill" "mai" "juuni" "juuli" "august" "september" "oktoober" "november" "detsember"] + :weekday-context-abbr ["E" "T" "K" "N" "R" "L" "P"] + :weekday-context-names ["esmaspäev" "teisipäev" "kolmapäev" "neljapäev" "reede" "laupäev" "pühapäev"] + :date-patterns (:short "d.MM.yy" :medium "d.MM.yyyy" :long "EEEE, d. MMMM yyyy. 'a'" :full "EEEE, d. MMMM yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z") + :date-time-pattern-rule (t . " ")) + (fi + :decimal-separator ?, + :eras ["eKr." "jKr."] + :month-context-abbr ["tammikuuta" "helmikuuta" "maaliskuuta" "huhtikuuta" "toukokuuta" "kesäkuuta" "heinäkuuta" "elokuuta" "syyskuuta" "lokakuuta" "marraskuuta" "joulukuuta"] + :month-context-names ["tammikuuta" "helmikuuta" "maaliskuuta" "huhtikuuta" "toukokuuta" "kesäkuuta" "heinäkuuta" "elokuuta" "syyskuuta" "lokakuuta" "marraskuuta" "joulukuuta"] + :weekday-context-abbr ["ma" "ti" "ke" "to" "pe" "la" "su"] + :weekday-context-names ["maanantai" "tiistai" "keskiviikko" "torstai" "perjantai" "lauantai" "sunnuntai"] + :month-standalone-abbr ["tammi" "helmi" "maalis" "huhti" "touko" "kesä" "heinä" "elo" "syys" "loka" "marras" "joulu"] + :month-standalone-names ["tammikuu" "helmikuu" "maaliskuu" "huhtikuu" "toukokuu" "kesäkuu" "heinäkuu" "elokuu" "syyskuu" "lokakuu" "marraskuu" "joulukuu"] + :am-pm ["ap." "ip."] + :date-patterns (:medium "d.M.yyyy" :long "d. MMMM'ta 'yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "'klo 'H.mm.ss" :full "H.mm.ss z") + :date-time-pattern-rule (t . " ")) + (fr + :decimal-separator ?, + :eras ["BC" "ap. J.-C."] + :month-context-abbr ["janv." "févr." "mars" "avr." "mai" "juin" "juil." "août" "sept." "oct." "nov." "déc."] + :month-context-names ["janvier" "février" "mars" "avril" "mai" "juin" "juillet" "août" "septembre" "octobre" "novembre" "décembre"] + :weekday-context-abbr ["lun." "mar." "mer." "jeu." "ven." "sam." "dim."] + :weekday-context-names ["lundi" "mardi" "mercredi" "jeudi" "vendredi" "samedi" "dimanche"] + :date-patterns (:short "dd/MM/yy" :medium "d MMM yyyy" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "HH' h 'mm z") + :date-time-pattern-rule (t . " ")) + (fr-BE + :date-patterns (:short "d/MM/yy" :medium "dd-MMM-yyyy" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "H' h 'mm' min 'ss' s 'z")) + (fr-CA + :date-patterns (:short "yy-MM-dd" :medium "yyyy-MM-dd" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "H' h 'mm z")) + (fr-CH + :date-patterns (:short "dd.MM.yy" :medium "d MMM yyyy" :long "d. MMMM yyyy" :full "EEEE, d. MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "HH.mm.' h' z")) + (ga + :eras ["RC" "AD"] + :month-context-abbr ["Ean" "Feabh" "Márta" "Aib" "Beal" "Meith" "Iúil" "Lún" "MFómh" "DFómh" "Samh" "Noll"] + :month-context-names ["Eanáir" "Feabhra" "Márta" "Aibreán" "Bealtaine" "Meitheamh" "Iúil" "Lúnasa" "Meán Fómhair" "Deireadh Fómhair" "Samhain" "Nollaig"] + :weekday-context-abbr ["Luan" "Máirt" "Céad" "Déar" "Aoine" "Sath" "Domh"] + :weekday-context-names ["Dé Luain" "Dé Máirt" "Dé Céadaoin" "Déardaoin" "Dé hAoine" "Dé Sathairn" "Dé Domhnaigh"] + :am-pm ["a.m." "p.m."] + :date-patterns (:short "yy/MM/dd" :medium "yyyy MMM d" :long "yyyy MMMM d" :full "EEEE, yyyy MMMM dd") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (ga-IE + :date-patterns (:short "dd/MM/yyyy" :medium "d MMM yyyy" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy")) + (he + :eras ["לסה"נ" "לפסה"נ"] + :month-context-abbr ["ינו" "פבר" "מרץ" "אפר" "מאי" "יונ" "יול" "אוג" "ספט" "אוק" "נוב" "דצמ"] + :month-context-names ["ינואר" "פברואר" "מרץ" "אפריל" "מאי" "יוני" "יולי" "אוגוסט" "ספטמבר" "אוקטובר" "נובמבר" "דצמבר"] + :weekday-context-abbr ["ב" "ג" "ד" "ה" "ו" "ש" "א"] + :weekday-context-names ["יום שני" "יום שלישי" "יום רביעי" "יום חמישי" "יום שישי" "שבת" "יום ראשון"] + :month-standalone-abbr ["ינו׳" "פבר׳" "מרץ" "אפר׳" "מאי" "יונ׳" "יול׳" "אוג׳" "ספט׳" "אוק׳" "נוב׳" "דצמ׳"] + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (nil . " ")) + (hi + :month-context-abbr ["Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"] + :month-context-names ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"] + :weekday-context-abbr ["Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"] + :weekday-context-names ["Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday"] + :date-patterns (:short "M/d/yy" :medium "MMM d, yyyy" :long "MMMM d, yyyy" :full "EEEE, MMMM d, yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :long "h:mm:ss a z") + :date-time-pattern-rule (t . " ")) + (hi-IN + :eras ["ईसापूर्व" "सन"] + :month-context-abbr ["जनवरी" "फ़रवरी" "मार्च" "अप्रैल" "मई" "जून" "जुलाई" "अगस्त" "सितंबर" "अक्तूबर" "नवंबर" "दिसंबर"] + :month-context-names ["जनवरी" "फ़रवरी" "मार्च" "अप्रैल" "मई" "जून" "जुलाई" "अगस्त" "सितंबर" "अक्तूबर" "नवंबर" "दिसंबर"] + :weekday-context-abbr ["सोम" "मंगल" "बुध" "गुरु" "शुक्र" "शनि" "रवि"] + :weekday-context-names ["सोमवार" "मंगलवार" "बुधवार" "गुरुवार" "शुक्रवार" "शनिवार" "रविवार"] + :am-pm ["पूर्वाह्न" "अपराह्न"] + :date-patterns (:short "d/M/yy" :medium "d MMM, yyyy" :long "d MMMM, yyyy" :full "EEEE, d MMMM, yyyy")) + (hr + :decimal-separator ?, + :eras ["Prije Krista" "Poslije Krista"] + :month-context-abbr ["sij" "velj" "ožu" "tra" "svi" "lip" "srp" "kol" "ruj" "lis" "stu" "pro"] + :month-context-names ["siječnja" "veljače" "ožujka" "travnja" "svibnja" "lipnja" "srpnja" "kolovoza" "rujna" "listopada" "studenoga" "prosinca"] + :weekday-context-abbr ["pon" "uto" "sri" "čet" "pet" "sub" "ned"] + :weekday-context-names ["ponedjeljak" "utorak" "srijeda" "četvrtak" "petak" "subota" "nedjelja"] + :month-standalone-abbr ["sij" "vel" "ožu" "tra" "svi" "lip" "srp" "kol" "ruj" "lis" "stu" "pro"] + :month-standalone-names ["siječanj" "veljača" "ožujak" "travanj" "svibanj" "lipanj" "srpanj" "kolovoz" "rujan" "listopad" "studeni" "prosinac"] + :date-patterns (:medium "yyyy.MM.dd" :long "yyyy. MMMM dd") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (hr-HR + :date-patterns (:short "dd.MM.yy." :medium "dd.MM.yyyy." :long "yyyy. MMMM dd")) + (hu + :decimal-separator ?, + :eras ["i.e." "i.u."] + :month-context-abbr ["jan." "febr." "márc." "ápr." "máj." "jún." "júl." "aug." "szept." "okt." "nov." "dec."] + :month-context-names ["január" "február" "március" "április" "május" "június" "július" "augusztus" "szeptember" "október" "november" "december"] + :weekday-context-abbr ["H" "K" "Sze" "Cs" "P" "Szo" "V"] + :weekday-context-names ["hétfő" "kedd" "szerda" "csütörtök" "péntek" "szombat" "vasárnap"] + :am-pm ["DE" "DU"] + :date-patterns (:medium "yyyy.MM.dd." :long "yyyy. MMMM d.") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z") + :date-time-pattern-rule (t . " ")) + (id + :decimal-separator ?, + :eras ["BCE" "CE"] + :month-context-abbr ["Jan" "Feb" "Mar" "Apr" "Mei" "Jun" "Jul" "Agu" "Sep" "Okt" "Nov" "Des"] + :month-context-names ["Januari" "Februari" "Maret" "April" "Mei" "Juni" "Juli" "Agustus" "September" "Oktober" "November" "Desember"] + :weekday-context-abbr ["Sen" "Sel" "Rab" "Kam" "Jum" "Sab" "Min"] + :weekday-context-names ["Senin" "Selasa" "Rabu" "Kamis" "Jumat" "Sabtu" "Minggu"] + :date-patterns (:short "yy/MM/dd" :medium "yyyy MMM d" :long "yyyy MMMM d" :full "EEEE, yyyy MMMM dd") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (id-ID + :date-patterns (:short "dd/MM/yy" :medium "dd MMM yy" :long "dd MMMM yyyy" :full "EEEE dd MMMM yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss")) + (is + :decimal-separator ?, + :month-context-abbr ["jan." "feb." "mar." "apr." "maí" "jún." "júl." "ágú." "sep." "okt." "nóv." "des."] + :month-context-names ["janúar" "febrúar" "mars" "apríl" "maí" "júní" "júlí" "ágúst" "september" "október" "nóvember" "desember"] + :weekday-context-abbr ["mán." "þri." "mið." "fim." "fös." "lau." "sun."] + :weekday-context-names ["mánudagur" "þriðjudagur" "miðvikudagur" "fimmtudagur" "föstudagur" "laugardagur" "sunnudagur"] + :date-patterns (:medium "d.M.yyyy" :long "d. MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (it + :decimal-separator ?, + :eras ["BC" "dopo Cristo"] + :month-context-abbr ["gen" "feb" "mar" "apr" "mag" "giu" "lug" "ago" "set" "ott" "nov" "dic"] + :month-context-names ["gennaio" "febbraio" "marzo" "aprile" "maggio" "giugno" "luglio" "agosto" "settembre" "ottobre" "novembre" "dicembre"] + :weekday-context-abbr ["lun" "mar" "mer" "gio" "ven" "sab" "dom"] + :weekday-context-names ["lunedì" "martedì" "mercoledì" "giovedì" "venerdì" "sabato" "domenica"] + :month-standalone-names ["Gennaio" "Febbraio" "Marzo" "Aprile" "Maggio" "Giugno" "Luglio" "Agosto" "Settembre" "Ottobre" "Novembre" "Dicembre"] + :date-patterns (:short "dd/MM/yy" :medium "d-MMM-yyyy" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy") + :time-patterns (:short "H.mm" :medium "H.mm.ss" :long "H.mm.ss z") + :date-time-pattern-rule (t . " ")) + (it-CH + :date-patterns (:short "dd.MM.yy" :medium "d-MMM-yyyy" :long "d. MMMM yyyy" :full "EEEE, d. MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "H.mm' h' z")) + (ja + :eras ["紀元前" "西暦"] + :month-context-abbr ["1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12"] + :month-context-names ["1月" "2月" "3月" "4月" "5月" "6月" "7月" "8月" "9月" "10月" "11月" "12月"] + :weekday-context-abbr ["月" "火" "水" "木" "金" "土" "日"] + :weekday-context-names ["月曜日" "火曜日" "水曜日" "木曜日" "金曜日" "土曜日" "日曜日"] + :am-pm ["午前" "午後"] + :date-patterns (:short "yy/MM/dd" :medium "yyyy/MM/dd" :full "yyyy'年'M'月'd'日'") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "H'時'mm'分'ss'秒' z") + :date-time-pattern-rule (t . " ")) + (ja-JP-u-ca-japanese-x-lvariant-JP + :date-patterns (:medium "Gy.MM.dd" :full "GGGGyyyy'年'M'月'd'日'")) + (ko + :eras ["기원전" "서기"] + :month-context-abbr ["1월" "2월" "3월" "4월" "5월" "6월" "7월" "8월" "9월" "10월" "11월" "12월"] + :month-context-names ["1월" "2월" "3월" "4월" "5월" "6월" "7월" "8월" "9월" "10월" "11월" "12월"] + :weekday-context-abbr ["월" "화" "수" "목" "금" "토" "일"] + :weekday-context-names ["월요일" "화요일" "수요일" "목요일" "금요일" "토요일" "일요일"] + :am-pm ["오전" "오후"] + :date-patterns (:short "yy. M. d" :medium "yyyy. M. d" :long "yyyy'년' M'월' d'일' '('EE')'" :full "yyyy'년' M'월' d'일' EEEE") + :time-patterns (:short "a h:mm" :medium "a h:mm:ss" :long "a h'시' mm'분' ss'초'" :full "a h'시' mm'분' ss'초' z") + :date-time-pattern-rule (t . " ")) + (lt + :decimal-separator ?, + :eras ["pr.Kr." "po.Kr."] + :month-context-abbr ["Sau" "Vas" "Kov" "Bal" "Geg" "Bir" "Lie" "Rgp" "Rgs" "Spa" "Lap" "Grd"] + :month-context-names ["sausio" "vasaris" "kovas" "balandis" "gegužė" "birželis" "liepa" "rugpjūtis" "rugsėjis" "spalis" "lapkritis" "gruodis"] + :weekday-context-abbr ["Pr" "An" "Tr" "Kt" "Pn" "Št" "Sk"] + :weekday-context-names ["Pirmadienis" "Antradienis" "Trečiadienis" "Ketvirtadienis" "Penktadienis" "Šeštadienis" "Sekmadienis"] + :month-standalone-abbr ["Saus." "Vas." "Kov." "Bal." "Geg." "Bir." "Liep." "Rugp." "Rugs." "Spal." "Lapkr." "Gruod."] + :month-standalone-names ["Sausio" "Vasario" "Kovo" "Balandžio" "Gegužės" "Birželio" "Liepos" "Rugpjūčio" "Rugsėjo" "Spalio" "Lapkričio" "Gruodžio"] + :date-patterns (:short "yy.M.d" :medium "yyyy-MM-dd" :long "EEEE, yyyy, MMMM d") + :time-patterns (:short "HH.mm" :medium "HH.mm.ss" :long "HH.mm.ss z") + :date-time-pattern-rule (t . " ")) + (lv + :decimal-separator ?, + :eras ["pmē" "mē"] + :month-context-abbr ["janv." "febr." "marts" "apr." "maijs" "jūn." "jūl." "aug." "sept." "okt." "nov." "dec."] + :month-context-names ["janvāris" "februāris" "marts" "aprīlis" "maijs" "jūnijs" "jūlijs" "augusts" "septembris" "oktobris" "novembris" "decembris"] + :weekday-context-abbr ["P" "O" "T" "C" "Pk" "S" "Sv"] + :weekday-context-names ["pirmdiena" "otrdiena" "trešdiena" "ceturtdiena" "piektdiena" "sestdiena" "svētdiena"] + :month-standalone-abbr ["Jan" "Feb" "Mar" "Apr" "Maijs" "Jūn" "Jūl" "Aug" "Sep" "Okt" "Nov" "Dec"] + :date-patterns (:short "yy.d.M" :medium "yyyy.d.M" :long "EEEE, yyyy, d MMMM") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (mk + :decimal-separator ?, + :eras ["пр.н.е." "ае."] + :month-context-abbr ["јан." "фев." "мар." "апр." "мај." "јун." "јул." "авг." "септ." "окт." "ноем." "декем."] + :month-context-names ["јануари" "февруари" "март" "април" "мај" "јуни" "јули" "август" "септември" "октомври" "ноември" "декември"] + :weekday-context-abbr ["пон." "вт." "сре." "чет." "пет." "саб." "нед."] + :weekday-context-names ["понеделник" "вторник" "среда" "четврток" "петок" "сабота" "недела"] + :date-patterns (:short "d.M.yy" :medium "d.M.yyyy" :long "d, MMMM yyyy" :full "EEEE, d, MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (ms + :eras ["BCE" "CE"] + :month-context-abbr ["Jan" "Feb" "Mac" "Apr" "Mei" "Jun" "Jul" "Ogos" "Sep" "Okt" "Nov" "Dis"] + :month-context-names ["Januari" "Februari" "Mac" "April" "Mei" "Jun" "Julai" "Ogos" "September" "Oktober" "November" "Disember"] + :weekday-context-abbr ["Isn" "Sel" "Rab" "Kha" "Jum" "Sab" "Ahd"] + :weekday-context-names ["Isnin" "Selasa" "Rabu" "Khamis" "Jumaat" "Sabtu" "Ahad"] + :date-patterns (:short "yy/MM/dd" :medium "yyyy MMM d" :long "yyyy MMMM d" :full "EEEE, yyyy MMMM dd") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (ms-MY + :date-patterns (:short "dd/MM/yyyy" :medium "dd MMMM yyyy" :full "EEEE dd MMM yyyy") + :time-patterns (:short "h:mm" :medium "h:mm:ss a" :long "h:mm:ss a z")) + (mt + :eras ["QK" "WK"] + :month-context-abbr ["Jan" "Fra" "Mar" "Apr" "Mej" "Ġun" "Lul" "Aww" "Set" "Ott" "Nov" "Diċ"] + :month-context-names ["Jannar" "Frar" "Marzu" "April" "Mejju" "Ġunju" "Lulju" "Awwissu" "Settembru" "Ottubru" "Novembru" "Diċembru"] + :weekday-context-abbr ["Tne" "Tli" "Erb" "Ħam" "Ġim" "Sib" "Ħad"] + :weekday-context-names ["It-Tnejn" "It-Tlieta" "L-Erbgħa" "Il-Ħamis" "Il-Ġimgħa" "Is-Sibt" "Il-Ħadd"] + :am-pm ["QN" "WN"] + :date-patterns (:short "dd/MM/yyyy" :medium "dd MMM yyyy" :long "d 'ta’' MMMM yyyy" :full "EEEE, d 'ta’' MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (nl + :decimal-separator ?, + :eras ["v. Chr." "n. Chr."] + :month-context-abbr ["jan" "feb" "mrt" "apr" "mei" "jun" "jul" "aug" "sep" "okt" "nov" "dec"] + :month-context-names ["januari" "februari" "maart" "april" "mei" "juni" "juli" "augustus" "september" "oktober" "november" "december"] + :weekday-context-abbr ["ma" "di" "wo" "do" "vr" "za" "zo"] + :weekday-context-names ["maandag" "dinsdag" "woensdag" "donderdag" "vrijdag" "zaterdag" "zondag"] + :date-patterns (:short "d-M-yy" :medium "d-MMM-yyyy" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "H:mm:ss' uur' z") + :date-time-pattern-rule (t . " ")) + (nl-BE + :date-patterns (:short "d/MM/yy" :medium "d-MMM-yyyy" :long "d MMMM yyyy" :full "EEEE d MMMM yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "H.mm' u. 'z")) + (nn-NO + :weekday-context-abbr ["må" "ty" "on" "to" "fr" "lau" "su"] + :weekday-context-names ["måndag" "tysdag" "onsdag" "torsdag" "fredag" "laurdag" "sundag"]) + (no + :decimal-separator ?, + :month-context-abbr ["jan" "feb" "mar" "apr" "mai" "jun" "jul" "aug" "sep" "okt" "nov" "des"] + :month-context-names ["januar" "februar" "mars" "april" "mai" "juni" "juli" "august" "september" "oktober" "november" "desember"] + :weekday-context-abbr ["ma" "ti" "on" "to" "fr" "lø" "sø"] + :weekday-context-names ["mandag" "tirsdag" "onsdag" "torsdag" "fredag" "lørdag" "søndag"] + :date-patterns (:short "dd.MM.yy" :medium "dd.MMM.yyyy" :long "d. MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "'kl 'HH.mm z") + :date-time-pattern-rule (t . " ")) + (pl + :decimal-separator ?, + :eras ["p.n.e." "n.e."] + :month-context-abbr ["sty" "lut" "mar" "kwi" "maj" "cze" "lip" "sie" "wrz" "paź" "lis" "gru"] + :month-context-names ["stycznia" "lutego" "marca" "kwietnia" "maja" "czerwca" "lipca" "sierpnia" "września" "października" "listopada" "grudnia"] + :weekday-context-abbr ["Pn" "Wt" "Śr" "Cz" "Pt" "So" "N"] + :weekday-context-names ["poniedziałek" "wtorek" "środa" "czwartek" "piątek" "sobota" "niedziela"] + :month-standalone-names ["styczeń" "luty" "marzec" "kwiecień" "maj" "czerwiec" "lipiec" "sierpień" "wrzesień" "październik" "listopad" "grudzień"] + :date-patterns (:short "yy-MM-dd" :medium "yyyy-MM-dd" :long "d MMMM yyyy" :full "EEEE, d MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (pl-PL + :date-patterns (:short "dd.MM.yy" :medium "yyyy-MM-dd" :long "d MMMM yyyy" :full "EEEE, d MMMM yyyy")) + (pt + :decimal-separator ?, + :eras ["a.C." "d.C."] + :month-context-abbr ["jan" "fev" "mar" "abr" "mai" "jun" "jul" "ago" "set" "out" "nov" "dez"] + :month-context-names ["Janeiro" "Fevereiro" "Março" "Abril" "Maio" "Junho" "Julho" "Agosto" "Setembro" "Outubro" "Novembro" "Dezembro"] + :weekday-context-abbr ["Seg" "Ter" "Qua" "Qui" "Sex" "Sáb" "Dom"] + :weekday-context-names ["Segunda-feira" "Terça-feira" "Quarta-feira" "Quinta-feira" "Sexta-feira" "Sábado" "Domingo"] + :date-patterns (:short "dd-MM-yyyy" :medium "d/MMM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE, d' de 'MMMM' de 'yyyy") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z" :full "HH'H'mm'm' z") + :date-time-pattern-rule (t . " ")) + (pt-BR + :date-patterns (:short "dd/MM/yy" :medium "dd/MM/yyyy" :long "d' de 'MMMM' de 'yyyy" :full "EEEE, d' de 'MMMM' de 'yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "H'h'm'min's's' z" :full "HH'h'mm'min'ss's' z")) + (ro + :decimal-separator ?, + :eras ["d.C." "î.d.C."] + :month-context-abbr ["Ian" "Feb" "Mar" "Apr" "Mai" "Iun" "Iul" "Aug" "Sep" "Oct" "Nov" "Dec"] + :month-context-names ["ianuarie" "februarie" "martie" "aprilie" "mai" "iunie" "iulie" "august" "septembrie" "octombrie" "noiembrie" "decembrie"] + :weekday-context-abbr ["L" "Ma" "Mi" "J" "V" "S" "D"] + :weekday-context-names ["luni" "marţi" "miercuri" "joi" "vineri" "sâmbătă" "duminică"] + :month-standalone-abbr ["ian." "feb." "mar." "apr." "mai" "iun." "iul." "aug." "sept." "oct." "nov." "dec."] + :date-patterns (:medium "dd.MM.yyyy" :long "dd MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (ru + :decimal-separator ?, + :eras ["до н.э." "н.э."] + :month-context-abbr ["янв" "фев" "мар" "апр" "мая" "июн" "июл" "авг" "сен" "окт" "ноя" "дек"] + :month-context-names ["января" "февраля" "марта" "апреля" "мая" "июня" "июля" "августа" "сентября" "октября" "ноября" "декабря"] + :weekday-context-abbr ["Пн" "Вт" "Ср" "Чт" "Пт" "Сб" "Вс"] + :weekday-context-names ["понедельник" "вторник" "среда" "четверг" "пятница" "суббота" "воскресенье"] + :month-standalone-abbr ["Янв." "Февр." "Март" "Апр." "Май" "Июнь" "Июль" "Авг." "Сент." "Окт." "Нояб." "Дек."] + :month-standalone-names ["Январь" "Февраль" "Март" "Апрель" "Май" "Июнь" "Июль" "Август" "Сентябрь" "Октябрь" "Ноябрь" "Декабрь"] + :date-patterns (:short "dd.MM.yy" :medium "dd.MM.yyyy" :long "d MMMM yyyy 'г.'") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z") + :date-time-pattern-rule (t . " ")) + (sk + :decimal-separator ?, + :eras ["pred n.l." "n.l."] + :month-context-abbr ["jan" "feb" "mar" "apr" "máj" "jún" "júl" "aug" "sep" "okt" "nov" "dec"] + :month-context-names ["januára" "februára" "marca" "apríla" "mája" "júna" "júla" "augusta" "septembra" "októbra" "novembra" "decembra"] + :weekday-context-abbr ["Po" "Ut" "St" "Št" "Pi" "So" "Ne"] + :weekday-context-names ["Pondelok" "Utorok" "Streda" "Štvrtok" "Piatok" "Sobota" "Nedeľa"] + :month-standalone-names ["január" "február" "marec" "apríl" "máj" "jún" "júl" "august" "september" "október" "november" "december"] + :date-patterns (:medium "d.M.yyyy" :long "EEEE, yyyy, MMMM d") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z") + :date-time-pattern-rule (t . " ")) + (sl + :decimal-separator ?, + :eras ["pr.n.š." "po Kr."] + :month-context-abbr ["jan." "feb." "mar." "apr." "maj" "jun." "jul." "avg." "sep." "okt." "nov." "dec."] + :month-context-names ["januar" "februar" "marec" "april" "maj" "junij" "julij" "avgust" "september" "oktober" "november" "december"] + :weekday-context-abbr ["Pon" "Tor" "Sre" "Čet" "Pet" "Sob" "Ned"] + :weekday-context-names ["Ponedeljek" "Torek" "Sreda" "Četrtek" "Petek" "Sobota" "Nedelja"] + :month-standalone-abbr ["jan" "feb" "mar" "apr" "maj" "jun" "jul" "avg" "sep" "okt" "nov" "dec"] + :date-patterns (:short "d.M.y" :medium "d.M.yyyy" :long "dd. MMMM y" :full "EEEE, dd. MMMM y") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z") + :date-time-pattern-rule (t . " ")) + (sq + :decimal-separator ?, + :eras ["p.e.r." "n.e.r."] + :month-context-abbr ["Jan" "Shk" "Mar" "Pri" "Maj" "Qer" "Kor" "Gsh" "Sht" "Tet" "Nën" "Dhj"] + :month-context-names ["janar" "shkurt" "mars" "prill" "maj" "qershor" "korrik" "gusht" "shtator" "tetor" "nëntor" "dhjetor"] + :weekday-context-abbr ["Hën" "Mar" "Mër" "Enj" "Pre" "Sht" "Die"] + :weekday-context-names ["e hënë" "e martë" "e mërkurë" "e enjte" "e premte" "e shtunë" "e diel"] + :am-pm ["PD" "MD"] + :date-patterns (:short "yy-MM-dd" :medium "yyyy-MM-dd") + :time-patterns (:short "h.mm.a" :medium "h:mm:ss.a" :long "h.mm.ss.a z") + :date-time-pattern-rule (t . " ")) + (sr + :decimal-separator ?, + :eras ["п. н. е." "н. е"] + :month-context-abbr ["јан" "феб" "мар" "апр" "мај" "јун" "јул" "авг" "сеп" "окт" "нов" "дец"] + :month-context-names ["јануар" "фебруар" "март" "април" "мај" "јун" "јул" "август" "септембар" "октобар" "новембар" "децембар"] + :weekday-context-abbr ["пон" "уто" "сре" "чет" "пет" "суб" "нед"] + :weekday-context-names ["понедељак" "уторак" "среда" "четвртак" "петак" "субота" "недеља"] + :date-patterns (:short "d.M.yy." :medium "dd.MM.yyyy." :full "EEEE, dd.MMMM.yyyy.") + :time-patterns (:short "HH.mm" :medium "HH.mm.ss" :long "HH.mm.ss z") + :date-time-pattern-rule (t . " ")) + (sr-BA + :month-context-names ["јануар" "фебруар" "март" "април" "мај" "јуни" "јули" "август" "септембар" "октобар" "новембар" "децембар"] + :weekday-context-abbr ["пон" "уто" "сри" "чет" "пет" "суб" "нед"] + :weekday-context-names ["понедељак" "уторак" "сриједа" "четвртак" "петак" "субота" "недеља"] + :date-patterns (:short "yy-MM-dd" :medium "yyyy-MM-dd" :long "dd. MMMM yyyy." :full "EEEE, dd. MMMM yyyy.") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH.mm.ss z" :full "HH 'часова', mm 'минута', ss' секунди'")) + (sr-Latn + :eras ["p. n. e." "n. e"] + :month-context-abbr ["jan" "feb" "mar" "apr" "maj" "jun" "jul" "avg" "sep" "okt" "nov" "dec"] + :month-context-names ["januar" "februar" "mart" "april" "maj" "jun" "jul" "avgust" "septembar" "oktobar" "novembar" "decembar"] + :weekday-context-abbr ["pon" "uto" "sre" "čet" "pet" "sub" "ned"] + :weekday-context-names ["ponedeljak" "utorak" "sreda" "četvrtak" "petak" "subota" "nedelja"] + :date-patterns (:short "d.M.yy." :medium "dd.MM.y." :long "dd. MMMM y." :full "EEEE, dd. MMMM y.") + :time-patterns (:short "HH.mm" :medium "HH.mm.ss" :long "HH.mm.ss z" :full "HH.mm.ss zzzz")) + (sr-Latn-BA + :eras ["p. n. e." "n. e"] + :month-context-abbr ["jan" "feb" "mar" "apr" "maj" "jun" "jul" "avg" "sep" "okt" "nov" "dec"] + :month-context-names ["januar" "februar" "mart" "april" "maj" "jun" "jul" "avgust" "septembar" "oktobar" "novembar" "decembar"] + :weekday-context-abbr ["pon" "uto" "sre" "čet" "pet" "sub" "ned"] + :weekday-context-names ["ponedeljak" "utorak" "sreda" "četvrtak" "petak" "subota" "nedelja"] + :date-patterns (:short "d.M.yy." :medium "dd.MM.y." :long "dd. MMMM y." :full "EEEE, dd. MMMM y.") + :time-patterns (:short "HH.mm" :medium "HH.mm.ss" :long "HH.mm.ss z" :full "HH.mm.ss zzzz")) + (sr-Latn-ME + :eras ["p. n. e." "n. e"] + :month-context-abbr ["jan" "feb" "mar" "apr" "maj" "jun" "jul" "avg" "sep" "okt" "nov" "dec"] + :month-context-names ["januar" "februar" "mart" "april" "maj" "jun" "jul" "avgust" "septembar" "oktobar" "novembar" "decembar"] + :weekday-context-abbr ["pon" "uto" "sre" "čet" "pet" "sub" "ned"] + :weekday-context-names ["ponedeljak" "utorak" "sreda" "četvrtak" "petak" "subota" "nedelja"] + :date-patterns (:short "d.M.yy." :medium "dd.MM.y." :long "d.MM.yyyy." :full "EEEE, dd. MMMM y.") + :time-patterns (:short "HH.mm" :medium "HH.mm.ss" :long "HH.mm.ss z" :full "HH.mm.ss zzzz")) + (sr-Latn-RS + :eras ["p. n. e." "n. e"] + :month-context-abbr ["jan" "feb" "mar" "apr" "maj" "jun" "jul" "avg" "sep" "okt" "nov" "dec"] + :month-context-names ["januar" "februar" "mart" "april" "maj" "jun" "jul" "avgust" "septembar" "oktobar" "novembar" "decembar"] + :weekday-context-abbr ["pon" "uto" "sre" "čet" "pet" "sub" "ned"] + :weekday-context-names ["ponedeljak" "utorak" "sreda" "četvrtak" "petak" "subota" "nedelja"] + :date-patterns (:short "d.M.yy." :medium "dd.MM.y." :long "dd. MMMM y." :full "EEEE, dd. MMMM y.") + :time-patterns (:short "HH.mm" :medium "HH.mm.ss" :long "HH.mm.ss z" :full "HH.mm.ss zzzz")) + (sv + :decimal-separator ?, + :eras ["före Kristus" "efter Kristus"] + :month-context-abbr ["jan" "feb" "mar" "apr" "maj" "jun" "jul" "aug" "sep" "okt" "nov" "dec"] + :month-context-names ["januari" "februari" "mars" "april" "maj" "juni" "juli" "augusti" "september" "oktober" "november" "december"] + :weekday-context-abbr ["må" "ti" "on" "to" "fr" "lö" "sö"] + :weekday-context-names ["måndag" "tisdag" "onsdag" "torsdag" "fredag" "lördag" "söndag"] + :am-pm ["fm" "em"] + :date-patterns (:short "yyyy-MM-dd" :medium "yyyy-MMM-dd" :long "'den 'd MMMM yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z" :full "'kl 'H:mm z") + :date-time-pattern-rule (t . " ")) + (th + :eras ["ปีก่อนคริสต์กาลที่" "ค.ศ."] + :month-context-abbr ["ม.ค." "ก.พ." "มี.ค." "เม.ย." "พ.ค." "มิ.ย." "ก.ค." "ส.ค." "ก.ย." "ต.ค." "พ.ย." "ธ.ค."] + :month-context-names ["มกราคม" "กุมภาพันธ์" "มีนาคม" "เมษายน" "พฤษภาคม" "มิถุนายน" "กรกฎาคม" "สิงหาคม" "กันยายน" "ตุลาคม" "พฤศจิกายน" "ธันวาคม"] + :weekday-context-abbr ["จ." "อ." "พ." "พฤ." "ศ." "ส." "อา."] + :weekday-context-names ["วันจันทร์" "วันอังคาร" "วันพุธ" "วันพฤหัสบดี" "วันศุกร์" "วันเสาร์" "วันอาทิตย์"] + :am-pm ["ก่อนเที่ยง" "หลังเที่ยง"] + :date-patterns (:short "d/M/yyyy" :medium "d MMM yyyy" :long "d MMMM yyyy" :full "EEEE'ที่ 'd MMMM G yyyy") + :time-patterns (:short "H:mm' น.'" :medium "H:mm:ss" :long "H' นาฬิกา 'm' นาที'" :full "H' นาฬิกา 'm' นาที 'ss' วินาที'") + :date-time-pattern-rule (t . ", ")) + (tr + :decimal-separator ?, + :eras ["MÖ" "MS"] + :month-context-abbr ["Oca" "Şub" "Mar" "Nis" "May" "Haz" "Tem" "Ağu" "Eyl" "Eki" "Kas" "Ara"] + :month-context-names ["Ocak" "Şubat" "Mart" "Nisan" "Mayıs" "Haziran" "Temmuz" "Ağustos" "Eylül" "Ekim" "Kasım" "Aralık"] + :weekday-context-abbr ["Pzt" "Sal" "Çar" "Per" "Cum" "Cmt" "Paz"] + :weekday-context-names ["Pazartesi" "Salı" "Çarşamba" "Perşembe" "Cuma" "Cumartesi" "Pazar"] + :date-patterns (:short "dd.MM.yyyy" :medium "dd.MMM.yyyy" :long "dd MMMM yyyy EEEE") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (t . " ")) + (uk + :decimal-separator ?, + :eras ["до н.е." "після н.е."] + :month-context-abbr ["січ." "лют." "бер." "квіт." "трав." "черв." "лип." "серп." "вер." "жовт." "лист." "груд."] + :month-context-names ["січня" "лютого" "березня" "квітня" "травня" "червня" "липня" "серпня" "вересня" "жовтня" "листопада" "грудня"] + :weekday-context-abbr ["пн" "вт" "ср" "чт" "пт" "сб" "нд"] + :weekday-context-names ["понеділок" "вівторок" "середа" "четвер" "п'ятниця" "субота" "неділя"] + :month-standalone-abbr ["січ" "лют" "бер" "квіт" "трав" "черв" "лип" "серп" "вер" "жовт" "лист" "груд"] + :month-standalone-names ["Січень" "Лютий" "Березень" "Квітень" "Травень" "Червень" "Липень" "Серпень" "Вересень" "Жовтень" "Листопад" "Грудень"] + :date-patterns (:short "dd.MM.yy" :medium "d MMM yyyy" :long "d MMMM yyyy" :full "EEEE, d MMMM yyyy р.") + :time-patterns (:short "H:mm" :medium "H:mm:ss" :long "H:mm:ss z") + :date-time-pattern-rule (t . " ")) + (und + :month-context-abbr ["Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"] + :month-context-names ["January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December"] + :weekday-context-abbr ["Mon" "Tue" "Wed" "Thu" "Fri" "Sat" "Sun"] + :weekday-context-names ["Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" "Sunday"] + :date-patterns (:short "M/d/yy" :medium "MMM d, yyyy" :long "MMMM d, yyyy" :full "EEEE, MMMM d, yyyy") + :time-patterns (:short "h:mm a" :medium "h:mm:ss a" :long "h:mm:ss a z") + :date-time-pattern-rule (t . " ")) + (vi + :decimal-separator ?, + :eras ["tr. CN" "sau CN"] + :month-context-abbr ["thg 1" "thg 2" "thg 3" "thg 4" "thg 5" "thg 6" "thg 7" "thg 8" "thg 9" "thg 10" "thg 11" "thg 12"] + :month-context-names ["tháng một" "tháng hai" "tháng ba" "tháng tư" "tháng năm" "tháng sáu" "tháng bảy" "tháng tám" "tháng chín" "tháng mười" "tháng mười một" "tháng mười hai"] + :weekday-context-abbr ["Th 2" "Th 3" "Th 4" "Th 5" "Th 6" "Th 7" "CN"] + :weekday-context-names ["Thứ hai" "Thứ ba" "Thứ tư" "Thứ năm" "Thứ sáu" "Thứ bảy" "Chủ nhật"] + :am-pm ["SA" "CH"] + :date-patterns (:short "dd/MM/yyyy" :medium "dd-MM-yyyy" :long "'Ngày' dd 'tháng' M 'năm' yyyy" :full "EEEE, 'ngày' dd MMMM 'năm' yyyy") + :time-patterns (:short "HH:mm" :medium "HH:mm:ss" :long "HH:mm:ss z") + :date-time-pattern-rule (nil . " ")) + (zh + :eras ["公元前" "公元"] + :month-context-abbr ["一月" "二月" "三月" "四月" "五月" "六月" "七月" "八月" "九月" "十月" "十一月" "十二月"] + :month-context-names ["一月" "二月" "三月" "四月" "五月" "六月" "七月" "八月" "九月" "十月" "十一月" "十二月"] + :weekday-context-abbr ["星期一" "星期二" "星期三" "星期四" "星期五" "星期六" "星期日"] + :weekday-context-names ["星期一" "星期二" "星期三" "星期四" "星期五" "星期六" "星期日"] + :am-pm ["上午" "下午"] + :date-patterns (:short "yy-M-d" :medium "yyyy-M-d" :long "yyyy'年'M'月'd'日'" :full "yyyy'年'M'月'd'日' EEEE") + :time-patterns (:short "ah:mm" :medium "H:mm:ss" :long "ahh'时'mm'分'ss'秒'" :full "ahh'时'mm'分'ss'秒' z") + :date-time-pattern-rule (t . " ")) + (zh-HK + :eras ["西元前" "西元"] + :month-context-abbr ["1月" "2月" "3月" "4月" "5月" "6月" "7月" "8月" "9月" "10月" "11月" "12月"] + :weekday-context-abbr ["一" "二" "三" "四" "五" "六" "日"] + :date-patterns (:short "yy'年'M'月'd'日'" :medium "yyyy'年'M'月'd'日'" :long "yyyy'年'MM'月'dd'日' EEEE") + :time-patterns (:short "ah:mm" :medium "ahh:mm:ss" :long "ahh'時'mm'分'ss'秒'" :full "ahh'時'mm'分'ss'秒' z")) + (zh-SG + :weekday-context-abbr ["周一" "周二" "周三" "周四" "周五" "周六" "周日"] + :date-patterns (:short "dd/MM/yy" :medium "dd-MMM-yy" :long "dd MMM yyyy" :full "dd MMMM yyyy") + :time-patterns (:medium "a hh:mm" :long "a hh:mm:ss")) + (zh-TW + :eras ["西元前" "西元"] + :month-standalone-abbr ["1月" "2月" "3月" "4月" "5月" "6月" "7月" "8月" "9月" "10月" "11月" "12月"] + :date-patterns (:medium "yyyy/M/d" :long "yyyy'年'M'月'd'日'" :full "yyyy'年'M'月'd'日' EEEE") + :time-patterns (:short "a h:mm" :medium "a hh:mm:ss" :long "ahh'時'mm'分'ss'秒'" :full "ahh'時'mm'分'ss'秒' z"))) + "Don't access directly, use `datetime-locale-field' instead.") + + +(provide 'datetime) + +;;; datetime.el ends here diff --git a/dev/HarvestData.java b/dev/HarvestData.java new file mode 100644 index 0000000000..1be8f577f8 --- /dev/null +++ b/dev/HarvestData.java @@ -0,0 +1,199 @@ +import java.text.*; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + + +public class HarvestData +{ + public static void main (String[] args) throws Exception + { + List <Locale> locales = new ArrayList <> (Arrays.asList (Locale.getAvailableLocales ())); + locales.sort ((a, b) -> a.toLanguageTag ().compareToIgnoreCase (b.toLanguageTag ())); + + Map <Locale, Map <String, String>> data = new LinkedHashMap <> (); + + List <String> english_eras = Arrays.asList (DateFormatSymbols.getInstance (Locale.ENGLISH).getEras ()); + List <String> english_am_pm = Arrays.asList (DateFormatSymbols.getInstance (Locale.ENGLISH).getAmPmStrings ()); + + for (Locale locale : locales) { + Map <String, String> map = new LinkedHashMap <> (); + data.put (locale, map); + + if (DecimalFormatSymbols.getInstance (locale).getDecimalSeparator () != '.') + map.put (":decimal-separator", String.format ("?%c", DecimalFormatSymbols.getInstance (locale).getDecimalSeparator ())); + + if (!Objects.equals (Arrays.asList (DateFormatSymbols.getInstance (locale).getEras ()), english_eras)) + map.put (":eras", toLispVector (Arrays.asList (DateFormatSymbols.getInstance (locale).getEras ()))); + + map.put (":month-context-abbr", toLispVector (getNames (locale, Calendar.MONTH, Calendar.SHORT_FORMAT, Calendar.JANUARY, Calendar.DECEMBER, -1))); + map.put (":month-context-names", toLispVector (getNames (locale, Calendar.MONTH, Calendar.LONG_FORMAT, Calendar.JANUARY, Calendar.DECEMBER, -1))); + map.put (":weekday-context-abbr", toLispVector (getNames (locale, Calendar.DAY_OF_WEEK, Calendar.SHORT_FORMAT, Calendar.MONDAY, Calendar.SATURDAY, Calendar.SUNDAY))); + map.put (":weekday-context-names", toLispVector (getNames (locale, Calendar.DAY_OF_WEEK, Calendar.LONG_FORMAT, Calendar.MONDAY, Calendar.SATURDAY, Calendar.SUNDAY))); + map.put (":month-standalone-abbr", toLispVector (getNames (locale, Calendar.MONTH, Calendar.SHORT_STANDALONE, Calendar.JANUARY, Calendar.DECEMBER, -1))); + map.put (":month-standalone-names", toLispVector (getNames (locale, Calendar.MONTH, Calendar.LONG_STANDALONE, Calendar.JANUARY, Calendar.DECEMBER, -1))); + map.put (":weekday-standalone-abbr", toLispVector (getNames (locale, Calendar.DAY_OF_WEEK, Calendar.SHORT_STANDALONE, Calendar.MONDAY, Calendar.SATURDAY, Calendar.SUNDAY))); + map.put (":weekday-standalone-names", toLispVector (getNames (locale, Calendar.DAY_OF_WEEK, Calendar.LONG_STANDALONE, Calendar.MONDAY, Calendar.SATURDAY, Calendar.SUNDAY))); + + if (!Objects.equals (Arrays.asList (DateFormatSymbols.getInstance (locale).getAmPmStrings ()), english_am_pm)) + map.put (":am-pm", toLispVector (Arrays.asList (DateFormatSymbols.getInstance (locale).getAmPmStrings ()))); + + removeUnnecessaryStandaloneStrings (map, ":month-standalone-abbr", ":month-context-abbr"); + removeUnnecessaryStandaloneStrings (map, ":month-standalone-names", ":month-context-names"); + removeUnnecessaryStandaloneStrings (map, ":weekday-standalone-abbr", ":weekday-context-abbr"); + removeUnnecessaryStandaloneStrings (map, ":weekday-standalone-names", ":weekday-context-names"); + + Map <String, String> date_patterns = toPatternPlist ((style) -> (SimpleDateFormat) DateFormat.getDateInstance (style, locale)); + Map <String, String> time_patterns = toPatternPlist ((style) -> (SimpleDateFormat) DateFormat.getTimeInstance (style, locale)); + + // Fallbacks: short <- medium; full <- long <- medium. + for (Map <String, String> patterns : Arrays.asList (date_patterns, time_patterns)) { + if (Objects.equals (patterns.get (":short"), patterns.get (":medium"))) + patterns.remove (":short"); + if (Objects.equals (patterns.get (":full"), patterns.get (":long"))) + patterns.remove (":full"); + if (Objects.equals (patterns.get (":long"), patterns.get (":medium"))) + patterns.remove (":long"); + } + + map.put (":date-patterns", toLispPlist (date_patterns, true)); + map.put (":time-patterns", toLispPlist (time_patterns, true)); + + boolean date_part_first = true; + String separator = null; + + for (int date_style : new int[] { DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, DateFormat.FULL }) { + for (int time_style : new int[] { DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, DateFormat.FULL }) { + String date_pattern = ((SimpleDateFormat) DateFormat.getDateInstance (date_style, locale)).toPattern (); + String time_pattern = ((SimpleDateFormat) DateFormat.getTimeInstance (time_style, locale)).toPattern (); + String date_time_pattern = ((SimpleDateFormat) DateFormat.getDateTimeInstance (date_style, time_style, locale)).toPattern (); + + if (separator == null) { + boolean found = false; + + search_loop: + for (boolean date_part_first_ : new boolean[] { true, false }) { + for (String separator_ : new String[] { " ", ", " }) { + if (Objects.equals (date_time_pattern, String.format ("%s%s%s", + date_part_first_ ? date_pattern : time_pattern, + separator_, + date_part_first_ ? time_pattern : date_pattern))) { + found = true; + date_part_first = date_part_first_; + separator = separator_; + break search_loop; + } + } + } + + if (!found) { + throw new IllegalStateException (String.format ("cannot determine separator:\n locale: %s\n date-time: %s\n date: %s\n time: %s", + locale.toLanguageTag (), date_time_pattern, date_pattern, time_pattern)); + } + } + + if (!Objects.equals (date_time_pattern, String.format ("%s%s%s", + date_part_first ? date_pattern : time_pattern, + separator, + date_part_first ? time_pattern : date_pattern))) { + throw new IllegalStateException (String.format ("unexpected date-time pattern:\n locale: %s\n date-time: %s\n date: %s\n time: %s", + locale.toLanguageTag (), date_time_pattern, date_pattern, time_pattern)); + } + } + } + + map.put (":date-time-pattern-rule", String.format ("(%s . %s)", date_part_first ? "t" : "nil", quoteString (separator))); + } + + // Remove duplicates. + for (Locale locale : locales) { + Locale parent = new Locale (locale.getLanguage ()); + if (Objects.equals (locale, parent)) + continue; + + if (Objects.equals (data.get (parent), data.get (locale))) + data.remove (locale); + else { + for (Iterator <Map.Entry <String, String>> it = data.get (locale).entrySet ().iterator (); it.hasNext ();) { + Map.Entry <String, String> entry = it.next (); + if (Objects.equals (entry.getValue (), data.get (parent).get (entry.getKey ()))) + it.remove (); + } + } + } + + for (Map.Entry <Locale, Map <String, String>> entry : data.entrySet ()) + System.out.println (toLispPlist (entry.getKey ().toLanguageTag (), entry.getValue (), false, 25)); + } + + protected static List <String> getNames (Locale locale, int field, int style, int from, int to, int extra) + { + Calendar calendar = Calendar.getInstance (locale); + List <String> names = new ArrayList <> (); + + for (int k = from; k <= to; k++) { + calendar.set (field, k); + names.add (calendar.getDisplayName (field, style, locale)); + + // Java is not very consistent here, sometimes standalone strings are just null, + // sometimes they duplicate context strings. + if (names.get (names.size () - 1) == null) + names.set (names.size () - 1, calendar.getDisplayName (field, style == Calendar.SHORT_STANDALONE ? Calendar.SHORT : Calendar.LONG, locale)); + } + + // Needed to put Sunday last. + if (extra >= 0) { + calendar.set (field, extra); + names.add (calendar.getDisplayName (field, style, locale)); + + if (names.get (names.size () - 1) == null) + names.set (names.size () - 1, calendar.getDisplayName (field, style == Calendar.SHORT_STANDALONE ? Calendar.SHORT : Calendar.LONG, locale)); + } + + return names; + } + + protected static void removeUnnecessaryStandaloneStrings (Map <String, String> properties, String standalone_key, String context_key) + { + if (Objects.equals (properties.get (standalone_key), properties.get (context_key))) + properties.remove (standalone_key); + } + + protected static String toLispPlist (Map <String, String> properties, boolean quote_value_strings) + { + return toLispPlist (null, properties, quote_value_strings, 0); + } + + protected static String toLispPlist (String associate_to, Map <String, String> properties, boolean quote_value_strings, int align_to_width) + { + return String.format ("(%s%s%s)", + associate_to != null ? associate_to : "", + associate_to != null && !properties.isEmpty () ? (align_to_width > 0 ? "\n " : " ") : "", + properties.entrySet ().stream ().map ((entry) -> String.format (align_to_width > 0 ? String.format ("%%-%ds %%s", align_to_width) : "%s %s", + entry.getKey (), + quote_value_strings ? quoteString (entry.getValue ()) : entry.getValue ())) + .collect (Collectors.joining (align_to_width > 0 ? "\n " : " "))); + } + + protected static String toLispVector (List <String> strings) + { + return String.format ("[%s]", strings.stream ().map ((string) -> quoteString (string)).collect (Collectors.joining (" "))); + } + + protected static Map <String, String> toPatternPlist (Function <Integer, SimpleDateFormat> format) + { + Map <String, String> patterns = new LinkedHashMap <> (); + + patterns.put (":short", format.apply (DateFormat.SHORT) .toPattern ()); + patterns.put (":medium", format.apply (DateFormat.MEDIUM).toPattern ()); + patterns.put (":long", format.apply (DateFormat.LONG) .toPattern ()); + patterns.put (":full", format.apply (DateFormat.FULL) .toPattern ()); + + return patterns; + } + + protected static String quoteString (String string) + { + return string != null ? String.format ("\"%s\"", string.replaceAll ("\\\\", "\\\\").replaceAll ("\"", "\\\"")) : "nil"; + } +} diff --git a/dev/harvest-data b/dev/harvest-data new file mode 100755 index 0000000000..a7cb5edd88 --- /dev/null +++ b/dev/harvest-data @@ -0,0 +1,2 @@ +#! /bin/sh +javac HarvestData.java && java HarvestData