GithubHelp home page GithubHelp logo

Comments (4)

samanzamani avatar samanzamani commented on June 4, 2024 1

سلام
در نسخه جدید متد ماهش ماه اضافه خواهد شد
subMonth

from persiandate.

mahramane avatar mahramane commented on June 4, 2024

خیلی لایبرری خوبی بود ممنون از زحماتتان
وقتی میخواییم یک ماه کم کنیم
pdate.addMonth(-1);
باید استفاده کنیم که کار نمیکنه

ما الان با این روش ماه قبل را دریافت میکنم .
int monthSh = pdate.getShMonth(); if (monthSh == 1) { monthSh = 12; } else { monthSh--; }

این کد مثل تابع pdate.addMonth(1) عمل نمیکنه
تابع addMonth بر روی کل تاریخ تاثیر میزاره یعنی در صورتی که به اسفند سال 1399 یک ماه اضافه کنی میشه فروردین سال 1400
اما تابع شما میشه فروردین همون سال 99
من از کد زیر برای دریافت ماه قبل استفاده کردم
val pDate = PersianDate().initJalaliDate(1399, 12, 0)
pDate.shMonth
pDate.monthName()
الان من ماه اسفند رو توی تاریخ وارد کردم ولی چون روز رو 0 وارد کردم توابع shMonth و monthName() ماه بهمن رو برمیگردونن
آقای زمانی لطفا در هر صورت تابع removMonth اضافه کنید
باتشکر

from persiandate.

samanzamani avatar samanzamani commented on June 4, 2024

سلام
با تشکر از نظر شما
در اپدیت بعد اضافه خواهد شد

from persiandate.

samanzamani avatar samanzamani commented on June 4, 2024

Since v1.4.0 you can get the former date with the below methods:

  • subDate(long SubYear, long SubMonth, long SubDay, long SubHour, long SubMinute,
    long SubSecond) code
  • subDate(long SubYear, long SubMonth, long SubDay) code
  • subYears(int years) //Subtract year
  • subYear() //Subtract a year
  • subMonths(int months)
  • subMonth()
  • subDays(int days)
  • subDay()
  • subHours(int hours)
  • subHour()
  • subMinutes(int minutes)
  • subMinute()
  • subSeconds(int seconds)
  • subSecond()

from persiandate.

Related Issues (20)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.